PDA

View Full Version : OpenGL equivalent for BaseVertexIndex?



12-21-2004, 05:52 AM
Hello,

I am looking for a way to add a constant offset to the values fetched from my index buffer. In our D3D renderer there's a function like:

HRESULT DrawIndexedPrimitive(D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount);

See here for explanation of the parameters: http://tomsdxfaq.blogspot.com/2002_05_01_tomsdxfaq_archive.html#77028718

Our OpenGL renderer does almost the same things the d3d one does, except i can't find something like the BaseVertexIndex parameter in OpenGL. It's quite handy when it comes to putting several models into one index/vertex buffer without splitting the index buffer into tiny chunks for each model (all that additional binding may affect performance and just some calls to the draw() function of each API is easier and faster).
Is there anything i can do to "emulate" this behaviour in OpenGL? I didn't find a suitable function or parameter that accomplishes this.

Thanks for your help!

-Matthias

12-21-2004, 06:25 AM
Check this out:

http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=012219