Adler
10-28-2004, 06:32 AM
Hello,
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.
Here my Fragment Shader Code:
varying float LightIntensity;
uniform sampler2D tex;
void
main (void)
{
vec3 color = vec3(texture2D(tex, gl_TexCoord[0].st));
color = color * LightIntensity;
gl_FragColor = vec4(color,1.0);
}
In the VertexShader the only relevant call
for TexCoords is:
gl_TexCoord[0] = gl_MultiTexCoord0;
In my Programm I don't forget to call glActiveTexture(GL_TEXTURE0) :-)
Thanks for any help.
Adler
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.
Here my Fragment Shader Code:
varying float LightIntensity;
uniform sampler2D tex;
void
main (void)
{
vec3 color = vec3(texture2D(tex, gl_TexCoord[0].st));
color = color * LightIntensity;
gl_FragColor = vec4(color,1.0);
}
In the VertexShader the only relevant call
for TexCoords is:
gl_TexCoord[0] = gl_MultiTexCoord0;
In my Programm I don't forget to call glActiveTexture(GL_TEXTURE0) :-)
Thanks for any help.
Adler