-
Vertex Color with Light
Hi, I have a simple cube that has vertex colors and normals. With no lighting (lighting altogether disabled) the vertex colors show fine. With lighting turned on the vertex colors don't show.
The lighting looks fine, but I thought it would 'add' to the vertex coloring, not remove it. Saying that, I haven't set up any material properties, could that be it?
Thanks
David
-
Senior Member
OpenGL Pro
Re: Vertex Color with Light
Are you using any textures for your cube or in another part of your code?
-
Re: Vertex Color with Light
No not at all.
Without the lights being enabled very little else is being done but definitely no textures, or texture coordinates - I haven't even set up any texture states.
-
Intern
Contributor
Re: Vertex Color with Light
with light u have to use color material glColorMaterial or glmaterial.
color material define how ur materials or bodies will react under lights .
with glColorMaterial u have to call glEnable(GL_COLOR_MATERIAL) then u change the current color using glColor.
and also dont forget to enable the lighting !
-
Re: Vertex Color with Light
That's great thanks.
So, just to confirm, vertex colors and lighting are mutually exclusive?
[EDIT] Ignore this, misread previous post
-
Super Moderator
OpenGL Lord
Re: Vertex Color with Light
-
Re: Vertex Color with Light

Originally Posted by
ZbuffeR
Not at all.
My Bad! Sorry - didn't read the original reply properly. Yes he is right and they are now working together
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules