glDrawArraysInstanced requires OpenGL 3.1. If you’re using the ARB_draw_instanced extension, you should be using glDrawArraysInstancedARB.
For which attributes? The per-instance attributes (non-zero divisor) or per-vertex attributes (zero divisor)?
The [var]first[/var] parameter to glDrawArraysInstanced specifies the offset for per-vertex (non-instanced, zero divisor) attributes. Per-instance attributes are always read starting from zero.
If you want to apply an offset for instanced attributes, you need to either use glDrawArraysInstancedBaseInstance() (which requires OpenGL 4.2 or later), or use glVertexAttribPointer() to offset the start of the attribute array(s) for instanced attributes.
I suspect you want to read up on ARB_base_instance and look at the glDrawArraysInstancedBaseInstance API. Alternatively, respecify your vertex attribute pointer(s) between draw calls.
Perfect, yes, the vertexpointer offset fixes it just right. Thanks very much.
I’m going to abandon this approach as i need to have the quads load the unique properties from the Vbo. however instancing as far as i understand only allows me to use the same texture coords for each instanced draw call.
i really want the attribute divisor by itself to reduce memory bandwidth, but the divisor and the instancing come as a package.
i suppose i could bundle tex coords as a vertex attribute to get around the vbo instancing cloning tex coords… but i would need to bundle quad dimensions to get the proper ratio… yuck.
Even so, supplying two <u,v> pairs per quad (origin and size) requires less memory than supplying four.
If you need unique attributes, you can use a texture or uniform array which is indexed based upon both gl_VertexID and gl_InstanceID. But texture/array lookups don’t pipeline as well as attributes.