gl_TextureMatrix[0]

In my vertex shader for point sprites, I have this line:

gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;

But it works just the same as this,

gl_TexCoord[0] = gl_MultiTexCoord0;

And just the same as this,

gl_TexCoord[0] = gl_Vertex;

What is the best choice here? I don’t know what the implications would be across different platforms and hardware.

I could buy that #1 and #2 are the same, depending on your texture matrix. But if #3 is the same, then your texture coordinate 0 would have to be the exact same thing as your vertex position. And if that isn’t the case, then something is very, very wrong.

Unless you have switched to texture matrix zero (using glActiveTexture and glMatrixMode(GL_TEXTURE_MATRIX)), then your texture matrix is the identity matrix. So the multiplication will do nothing.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.