GL Lighting && Vertex Colors?

Started by
1 comment, last by MrTors 22 years, 8 months ago
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
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...

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.

This topic is closed to new replies.

Advertisement