guys, I am trying to make use of glVertexAttribDivisor in my OpenGL instanced drawing.
It works in NV card, but it doesn't work in ATI card. Nothing is drawing.
From GlExtensionViewer, it shows both of these cards supports glVertexAttribDivisor/ InstancedStream. There was no error at running.
I don't know if this is due to my wrong usage.
I put the instance data in a separate vertex array buffer, then map it into gl_MultiTexCoord0~3. The instance data is the world matrix.
Code is here.
for( int i=0;i<3;i++)
{
glClientActiveTexture(kGL_TEXTURE0 + i);
glTexCoordPointer(size, type, stride, i*4*sizeof(float));
int instanceVertexAttribIndex = i + 8;
glVertexAttribDivisorARB(instanceVertexAttribIndex, 1);
}
The key issue is what the right "index" should I give to glVertexAttribDivisorARB if I try to put the instance data on gl_MultiTexCoord0?