View Full Version : warning: no vertex attribute is explicitly assigned to vertex attribute zero

01-31-2007, 09:43 PM
What does this warning mean?


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

01-31-2007, 09:57 PM
Vetex attribute zero is special, so you always have to have it active with an attribute when using shaders. (more for legacy reasons)

01-31-2007, 10:57 PM
Have a look at this thread (http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=11;t=001319) .

02-01-2007, 04:30 AM
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

02-01-2007, 06:06 AM
Have you tried explicitly assigning an attribute to vertex attribute 0? That seems to be what everyone is suggesting.

Hope it helps...


02-01-2007, 09:37 AM
ok, I was a bit confused by the terms used. I understand now, something like
a = gl_Vertex.x;does the trick.

02-01-2007, 06:07 PM
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.

02-01-2007, 09:29 PM
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.

02-01-2007, 09:56 PM
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.