OpenGL ES 1.1 is it possible to have both - vertexColors AND lighting?

瘦欲@ 提交于 2019-12-13 04:58:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!