Vertex Color and Lighting

Started by
4 comments, last by Emilio 22 years, 2 months ago
here''s the prob... the color of my vertices are not used on the lighting calculations... how can i fix it?? thanks in advance
Advertisement
enable lighting, enable a light, set the light color, position, etc. set the normal for the vertices. end of discussion.

if you want more information on lighting, check out the OpenGL programmer''s guide. http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
hi, thanks for the link...

now, i dont think you got what the prob is... lets say i have a mesh with all colors in red... if i disable lighting, it shows it all red, with the ligh enabled, its not even a lil bit red, so im assuming im missing something.

well i''m not sure. things to check for, would be, where is your light in the world space? what is your light color (ambient & diffuse)? do you have face culling enabled? if so, back face culling, front face culling? what''s front face, clockwise, counter clockwise? are your normals set properly? if your not using color material, disable it?

if you want to paste some source, it may help?

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
>> the color of my vertices are not used on the lighting calculations<<

see the faq at www.opengl.org (section lighting + MATERIALS )

http://uk.geocities.com/sloppyturds/gotterdammerung.html
thank you guys...

the answer is... glColorMaterial, it makes gl use your colors as materials.

thanks again.

This topic is closed to new replies.

Advertisement