PDA

View Full Version : gl_TextureMatrix[0]



Jeffg
11-02-2010, 06:19 PM
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.

Alfonse Reinheart
11-02-2010, 08:15 PM
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.