PDA

View Full Version : Batching/Vertex Buffers


ttigue
09-17-2003, 12:21 PM
I have a question about batching. I have seen it mentioned and described to an extent in some tutorials. From what I can understand it is using one large vertex buffer so that the graphics card does not have to switch to other vertex buffers, right? Can I use one vertex buffer for two different models. For example, if I had a cube and sphere model put into one vertex buffer. Then I use Index buffers like this-

SetMatrices()
SetMaterials()
DrawIndexedPrimitive(vertex_buffer,cube_start,cube _end....)
SetMatrices()
SetMaterials()
DrawIndexedPrmitive(vertex_buffer,sphere_start,sph ere_end....)

Is that right and/or efficient? Or am I totally off base?

anubis
09-17-2003, 12:41 PM
yep, you got the idea