Question

I can't find much info on this function regarding setup. I have 2 VBO's. The first containing position, normal, and color info bound to GL_ARRAY_BUFFER. The second is the index buffer bound to GL_ELEMENT_ARRAY_BUFFER. On a non-instanced draw call I am getting the correct models drawn to the screen, but when I do the same call with instanced rendering I get half of the primitives in each instance missing. I am doing a uniform array filled with translate data indexed by gl_InstanceID. The translations are working, but half of the primitives are not showing up. I have ruled out culling as the issue. I figured that since number of indices passed is required that the draw call would look up the GL_ELEMENT_ARRAY_BUFFER and stride based on the passed in count value. Could somebody explain to me what is going on behind the scenes?

Was it helpful?

Solution

because glDrawArraysInstanced doesn't use the element buffer but glDrawElementsInstanced does

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top