开发者

gl_NormalMatrix and gl_ModelViewProjectionMatrix in GLES 2.0 (WebGL)

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜