Problem with gl_MultiTexCoord0

Started by
2 comments, last by ZaPPZion 14 years ago
Hi everyone, I'm doing some shader work in OpenGL, but I've run across a problem. When i render my mesh with the ffp, it renders correctly, but when I use a custom shader, it doesn't get the gl_MultiTexCoord0 attributes. It's actually really weird, I've tested it on multiple pc's, my desktop runs it fine, correct textures, my laptop (nvidia gfx card) however fails to get those texcoords. Another laptop with an ATI gfx card reproduced the same problem, but other laptops I've tried display correctly. It's really the simplest shader ever:

attribute vec4 gl_MultiTexCoord0;
void main() {
  gl_TexCoord[0] = gl_MultiTexCoord0;
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
To summarize: gl_MultiTexCoord0 is always (0,0,0,0), tried setting the position to it to debug. I've tried a lot of things, like binding textures and setting active textures etc. However I've never been able to fix this. Does anyone have a solution/suggestion that might fix this problem? Greetings, Bart
Advertisement
You don't need to declare gl_MultiTexCoord0 for it to work. Remove it and test.
Like Huntsman said you don't need to declare gl_MultiTexcoordn since those are reserved by GLSL . The only way you are going to get values from your app into that attribute is to use glMultiTexCoord*f in you code.
Ahh thanks ;)
I tried almost everything, but it was a combination of options i tried. My drivers are stricter i guess, it need to render the vertices with glMultiTexCoord4f instead of 2f and I can't declare the attribute.

Thanks again:)

EDIT: Correction, multitexcoord2f works as well now, somehow.

This topic is closed to new replies.

Advertisement