i work on an Radeon 9800 with GLSL, and I’ve a problem with generated Texture Coordinates.
If I draw a Quad an gave it Texture Coordinates with glTexCroord3f I can map the Texture with the registrated sampler. If I remove the glTexCoord calls an use Texture Generation instead, i sea a gray plane, but I expect a Texture there.
If I deaktivate the Shader, the Mapping works fine.
In short:
Expilzit Texture Coords with Shader works
Generated Texture Coords without Shader works
Generated Texture Coords with Shader fails.
In short:
Expilzit Texture Coords with Shader works
Generated Texture Coords without Shader works
Generated Texture Coords with Shader fails.
…
Adler[/b]
Vertex Shaders REPLACE:
Vertex Transformation[]Normal Transformation (including rescale and normalize)[]TexCoord Generation and Transformation[*]…
Therefore, YOU, the shaderwriter, are responsible for providing the shader code to do TexCoord Generation and Transformation!
.
See Randi Rost’s book “OpenGL Shading Language,” Section 9.7 for shader code to do texcoord generation.
.
-mr. bill
Originally posted by mrbill:
Therefore, YOU, the shaderwriter, are responsible for providing the shader code to do TexCoord Generation and Transformation!
-mr. bill
Thanks a lot. I forgot this. I reread the Chapter.
But there is a nother Question. I’ve got a Plane with 32x32 vertecies, for example and a shader for this. If I’ve in the Vertex Shader this:
gl_TexCoord[0] = gl_MultiTexCoord0;
and I 'don’t use gl_TexCoord[0] in the Fragment Shader I’ve got something like a Ramp from high LightIntensity to low LightIntensity on the Plane. Why? Vendor spezific implementation behavoir?