Piao
Piao

Reputation: 39

How can I convert from OpenGL GLSL code to OpenGL ES GLSL code

I am trying to convert glsl for opengl to glsl for opengl es.

Here is glsl code that I'm going to translate.

I want to know how I can translate gl_TextureMatrix[0], gl_TextureMatrix[1], and gl_TextureMatrix[0][0][0]. What do they mean?

Upvotes: 1

Views: 3010

Answers (1)

Tim
Tim

Reputation: 35933

gl_TextureMatrix is a transform matrix that transforms the texture coordinates (for example if you wanted to rotate or scale the texture on a static shape.

It is a deprecated built-in variable in standard OpenGL. The proper way to handle this in modern OpenGL/OpenGLES would be to declare your own uniform matrices instead of using the built-in gl_TextureMatrix, and update these uniform matrices instead of performing rotations/translations to OpenGL's GL_TEXTURE_MATRIX.

Upvotes: 2

Related Questions