Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

891225 Posts in 33531 Topics- by 24772 Members - Latest Member: Lumenox_Games

June 19, 2013, 08:44:57 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Light reveals hidden texture...or something
Pages: [1]
Print
Author Topic: Light reveals hidden texture...or something  (Read 129 times)
giantrobotbee
Level 0
*


View Profile
« on: June 18, 2013, 07:37:07 AM »

I'm just trying to work through an idea conceptually in order to put together a POC. I'm still pretty new at doing graphics programming so I'm not really sure what the appropriate method would be to go about making this.

Essentially, I have a side-scrolling scene and there's a floating light source (think Navi without the incessant shouting) who casts light on the background and other objects in the scene. Anything within the scene that the light falls on should reveal a secondary texture (and perhaps in certain cases, new geometry). For example, if there is a dead tree in the scene and the light falls on the top of the tree, the tree will now have leaves and be "alive".

What would be the best way to go about implementing such a thing?
Logged
Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #1 on: June 18, 2013, 07:56:11 AM »

Have the light's intensity adjust the opacity of the rendered pixels in a fragment shader.
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, oboe (?!)
Game audio programming consultant.
<plaid/audio> 0.2: opensource audio framework
8BitPimp
Level 0
**


View Profile WWW Email
« Reply #2 on: June 18, 2013, 10:40:22 AM »

It would all depend on your chosen drawing API, or the engine you would work with, if any.  What language and API are you wanting to work with?  For instance and approach using SDL would be vastly different to one using Direct3D.
Logged

giantrobotbee
Level 0
*


View Profile
« Reply #3 on: June 18, 2013, 03:18:37 PM »

Likely an OpenGL implementation though I've considered Unity. Lets assume OpenGL.
Logged
dr.crow
Level 0
***



View Profile
« Reply #4 on: June 18, 2013, 04:12:18 PM »

If you know how to use the new opengl directly, it should be fairly trivial to implement.
Like evan said, it's just a matter of blending the two textures in a fragment shader.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic