Archived

This topic is now archived and is closed to further replies.

WarAmp

Color mixing hell.

Recommended Posts

In my small test engine, I currently playing around with lighting techniques, and I decided to do an experiment. All my textures in the world are just greyscale images, where each pixel represents the amount of light reflected. (black = no reflection, white = 100% reflection) to light a surface, I draw a polygon of whatever color over top of the texture. My question is this: what type of blending function should I use? (OpenGL) I was using glBlendFunc(GL_ZERO, GL_SRC_COLOR) because that should multiply the luminance pixel by the color of the light, and it works if I only have 1 light in the scene. If I have more than 1 light, say a red, green, and blue light, all I get is black... Can anyone help me out? I would really appreciate it. /************************************** * Hookt on Fonix relly werked fer mee! * WarAmp ***************************************/

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
try mixing red,green and blue light using "additive alpha blending" method and then you mix it with the texturized polygons later.

Share this post


Link to post
Share on other sites