Yes I’m sure this isn’t the problem. I’m using glActiveTexture(GL_TEXTURE0) right before glMatrixMode(GL_TEXTURE).
Besides every Matrix manipulation but gluPerspective(…) works with my shader.
gluPerspective(…) does change the result when running the aplication with the shaderprogram, but it doesn’t change it the same way as without a shader. So I think that the multiplication of the texturecoordinates with the texturemarix must be wrong…
before and after the gluPerspective call, both with and without shaders, see if you get the same values. if you don’t, it’s an glu/shaders interaction problem, if you do, there’s something wrong in your shaders… try, try, try
I tryed it and I got the same results with and without shader…
So somethig is wrong in my shader? But my Shaderpair is so simple… Do I have to do something else with the texturecoordinates than
“gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;”?
I compared the resulds in “matrix” whith those in the shader and they were identical… So that means that
"gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
is wrong or the standard shaderprogram does something else with the Texturecoordinates…
Try also calling glClientActiveTexture, just for fun… or, if you go for the shaders, just let go of the old way and (calculate and) upload the matrices to your shaders by hand in custom variables just to be sure…
The bug is your fragment shader. If your texture matrix is not trivial then you end up with homogenous texture coordinates with w != 1. So your fragment shader must use textureProj() with full vec4 coordinate.
Wowww, mfort, I just tried what you wrote… and it immediately worked as I wanted it… Thank you very much. I almost gave up on my project, because it didn’t work.
I do not realy know the difference between textureProj() and texture2D() yet, but I’ll read about it soon…
I thank everyone who took some time thinking about my problem…