View Full Version : BLENDING & LIGHTING problems

10-01-2000, 04:27 PM
When I draw an object with a texture attached to it (GL_RGB8) and I make it transparent by modulating the texture with an alpha color e.g. glColor4f(1,1,1,0.5);
the object gets transparent only when I have disabled GL_LIGHTING. When I turn on lights the objects becomes opaque.
Does anyone have any idea why this happens?

10-01-2000, 09:27 PM
When lighting is enabled, the alpha for your primary color at each vertex comes from the alpha component of the diffuse material color.

So set the alpha of your diffuse material to 1.0 if you want opaque and 0.5 (or whatever) if you want transparent.

10-05-2000, 01:27 PM
Thanks it Worked.

I have another question now. What values should I put to the LIGHT ATTENUATION parameters to emulate an omni positional light of radius "X" ? (objects outside light sphere should not be lit)