PDA

View Full Version : OGL lighting calculation erasing alpha given w/ glcolor4f ?



brucemangy
04-24-2004, 09:00 AM
Hi all,
I'm rendering an heightmap with gouraud shading.
I'm trying to begin the texturing part.
I'm doing several pass to blend the different textures and i'm using alpha blending to fade them.
Each point have it's own alpha coeficient.
With the lights disabled there is no problem.
But it seems that the OpenGL lighting calculation is overwriting the colors i have sets with a glColor4f when the lights are enabled. :(
I can obtain the result i want with one more pass , but i'm sure there is a way to keep my alpha component even with the OGL lighting.
(i'm using vertex array : blocks of 9x9 vertices, 128 triangles and i only change the Color Array and the bindtexture between each pass).

Any help would be appreciated.
:rolleyes:

brucemangy
04-24-2004, 12:51 PM
glEnable(GL_COLOR_MATERIAL); is my friend ^^
found the solution somewhere on this forum...

thx anyway ^^