I’m trying to use glVertexAttribPointer instead of the normal glVertexPointer, glColorPointer, etc. But I can’t get it to work in my program. Shouldn’t these be equivalent?
glColorPointer(4, GL_FLOAT, sizeof(SVertexBasis), &vl->dux);
glVertexAttribPointerNV(3, 4, GL_FLOAT, sizeof(SVertexBasis), &vl->dux);
But, while the first works perfectly with my vertex program, the second does absolutely nothing at all. Using the glVertexAttribPointer function, my scene is rendered with whatever color was last set with glColor. I have the same problem if I try and use glVertexAttribPointer(0, …) instead of glVertexPointer. Can anyone tell me what I’m doing wrong? I’ve tried calling the glGetVertexAttribPointer to see if it was even getting set, but it returns the correct address to my data. Is there another state that I may be forgetting to set?
BTW, here’s the vertex program I’m using. It was originally more complicated, but I stripped it down to just this while trying to debug this problem.
DP4 o[HPOS].x, c, v;
DP4 o[HPOS].y, c, v;
DP4 o[HPOS].z, c, v;
DP4 o[HPOS].w, c, v;
MOV o[TEX0], v;
MOV o[TEX1], v;
MOV o[COL0], v;