开发者

gl_NormalMatrix and gl_ModelViewProjectionMatrix in GLES 2.0 (WebGL)

开发者 https://www.devze.com 2023-03-18 22:33 出处:网络
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

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

精彩评论

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