• Advertisement

Archived

This topic is now archived and is closed to further replies.

GL Lighting && Vertex Colors?

This topic is 5997 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I''m somewhat new to openGL, but not too new to 3D concepts. I want to do specify vertex colors along with vertex/face normals for lighting. Is it possible to have both color values from the lighting and the vertex color interpolated over the poly having openGL do it or will have I have to do my own lighting... I''m sure somewhere something says how to do it, but I''m a little lazy in researching for certain things, since I''m really not too interested in the actual graphics processing. If anyone has a quick answer for me please feel free to respond!! Thanks in advance! Robert

Share this post


Link to post
Share on other sites
Advertisement
Its been a while since I''ve messed with this stuff directly, so don''t bet your life on my being correct, but I believe that if you specify the vertex color materials as being emissive, they will be combined with the lighting equation in the the way that you want, eg:

glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK,GL_EMISSION);

Do your normal polygon setup, using colormats, and put some lights in the scene as usual...

Share this post


Link to post
Share on other sites
Hmm.. I''ve tried messing with the materials already, but it seems the materials are changed per face not per vertex.. maybe I''m just doing it wrong.

Share this post


Link to post
Share on other sites

  • Advertisement