Ilyes Gouta
Ilyes Gouta

Reputation: 31

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

Upvotes: 0

Views: 3075

Answers (2)

bl4ckr4ven
bl4ckr4ven

Reputation: 1

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.

Upvotes: 0

Dr. Snoopy
Dr. Snoopy

Reputation: 56347

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.

Upvotes: 1

Related Questions