Warning: no vertex attribute is explicitly assigned to vertex attribute zero

What does this warning mean?


warning: no vertex attribute is explicitly assigned to vertex attribute zero

Vetex attribute zero is special, so you always have to have it active with an attribute when using shaders. (more for legacy reasons)

Have a look at this thread .

I’m sorry but I do still not understand what I have to do to get rid of that warning…

al I am doing is draw a bunch of vertices and manipulate their position using a texture fetch

Have you tried explicitly assigning an attribute to vertex attribute 0? That seems to be what everyone is suggesting.

Hope it helps…


ok, I was a bit confused by the terms used. I understand now, something like

a = gl_Vertex.x;

does the trick.

Uh, That may fix is as you are now requiring the shader to read from the vertex position, but it may be a bit hacky. (Ie may break in future)

I assume you pass some vertex attributes to the shader? Just make sure one of them is using attribute 0.

Also, post your vertex shader and set up code and we may be able to point out the mistake.

ok my very simple vertex shader looks as follows:

uniform sampler2D texUnit;

void main()
    vec2 texCoord = vec2(gl_MultiTexCoord0);
    vec4 c  = texture2D(texUnit, texCoord);
    gl_Position = gl_ModelViewProjectionMatrix * c;

I have put a number of vertex positions into a texture and have sent it to GPU memory. Then I use drawarrays using a vertexpointer and a texcoordpointer. The vertices are displayed correctly on screen.

Arr, ok I see now.

If you wanted to fix this, you would have to replace gl_MultiTexCoord0 with a vertex attribute and set the attribute number to zero.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.