glDrawArrays with specified number of vertexes per primitive
I'm currently making a rendering system for many types of objects using the VBO method. The objects may have varying numbers of vertices/object, and may also use different primitive types.
If the primitive type is triangle or quad, rendering lots of these as some sort of 2d-sprite is not o problem since the start and stop-vertice is always assumed by this type of primitive type. But, when using any other type, like trianglestrip, I can't render a lots of these without them all being glued toghether. I can't sort them up in a batch of primitives since I can't specify the start and stop of each primitive object.
So, did I miss something, or may this be possibly?
Can I somehow tell the rendering system when using glRenderelements/glRenderArrays where the start and stops of the primitive type - like lines/trianglestrip/trianglefan - will be?
Sounds like you want glMultiDrawArrays/glMultiDrawElements. It's basically a macro for multiple calls to glDrawArray/glDrawElements.
I'd suggest uploading the vertex data to the GPU, creating an index list and then using glDrawRangeElements().
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement