PDA

View Full Version : Simple Q: vertex colors + lighting?



sourcerer
02-04-2007, 12:02 PM
Hi,
I have a simple question. I am rendering a scene in fixed function mode from vertex buffers, with one light enabled, untextured. Now for debugging purposes I wantesd it to also show color so I extended it to include a color in the vertex format and I also bind the colors.
This works when I disable the lighting (everything is colored), but when I enable lighting I see everything lit again as if it were white (I set all vertex colors to red).
Is it possible to enable vertex colors and still have light influence it? I'd think so but I can't get it to work :eek: \

Any help would definitely be appreciated.

Kaj

zeoverlord
02-04-2007, 02:40 PM
Yes add the line glEnable(GL_COLOR_MATERIAL);

sourcerer
02-05-2007, 11:50 AM
Thank you very much :eek: ) I knew it had to be something simple....but what!?!

Kaj