问题
If I have a mesh that uses vertexColors and then enable GL_LIGHTING, then the vertexColors will be ignored and replaced by the calculated lighting.
Is there a way in OpenGL ES 1.1 to have both at the same time - vertex colors & dynamic lighting?
thanks!
回答1:
You can use
glEnable(GL_COLOR_MATERIAL);
to have the material parameters track the current color. On desktop OpenGL implementations there is also glColorMaterial to configure if the color is to be applied as the ambient of diffuse value, in OpenGL-ES I think it alway applies to both.
来源:https://stackoverflow.com/questions/4841715/opengl-es-1-1-is-it-possible-to-have-both-vertexcolors-and-lighting