PDA

View Full Version : shading 2d textures darker



johannesprix
08-29-2003, 12:05 AM
For my isometric 2d application, I would like to introduce 'fake' light, i.e. render some objects of the game darker depending on whether they are close to another light-radiating object or not.

I know I could, say, prepare 5 different pixmaps with different shadings before making textures out of them and then using one of these textures depending on the light. But that appears a bit unconvenient and not very efficient to me. So my question is this: Is there some (fast) method to make a (2d) texture for a 2d application darker or lighter when rendering it or maybe even apply, say, a blue color filter?

Thanks a lot for your thoughts.

See ya, Johannes.

PanzerSchreck
08-29-2003, 01:19 AM
Just use glColor3f before you draw your textured quad.glColor3f(0.1, 0.1, 0.1) for example will make your texture look very dark, whereas glColor3f(0,0,1) will give it a blue color.

johannesprix
08-29-2003, 11:11 PM
Hey, now that was exactly what I wanted to know! Thanks a thousand times!