Batching/Vertex Buffers

Da0fa930e68676fa278377ca430e02a7
0
ttigue 101 Sep 17, 2003 at 18:21

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,sphere_end….)

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

1 Reply

Please log in or register to post a reply.

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Sep 17, 2003 at 18:41

yep, you got the idea