Are gl_ModelViewProjectionMatrix and gl_NormalMatrix matrices开发者_运维百科 (or similar forms) supported in OpenGL ES 2.0? That's computed automatically by GL, provided the modelview matrix and the initial matrix and then automatically passed to the vertex shader?
Thanks,
-Ilyes
OpenGL ES 2.0 doesn't have any built-in matrices or variables (except for gl_Position), so you have to calculate them by yourself and upload them to the shader as uniform variables.
gl_ModelViewProjectionMatrix, you can use ViewProjectMatrix uniformly send from the OpenGL application to the shader.
gl_NormalMatrix, try using WorldViewInverseTranspose again send uniformly from the application.
精彩评论