How to draw multiple objects with Direct3D?

Started by
2 comments, last by 3DModelerMan 9 years, 8 months ago

Lately, I've been trying to draw multiple objects with Direct3D and I just don't understand how I'm supposed to draw different objects on the screen with multiple vertex buffers. On MSDN, I read that a GPU could only hold 16 vertex buffers, so creating one vertex buffer per object doesn't make much sense to me. I know it is possible to put many static meshes into a single vertex buffer, but since mine are dynamic, how am I supposed to do that?

Advertisement


On MSDN, I read that a GPU could only hold 16 vertex buffers... [within each draw call].
You can make use of 16 buffers simultaneously -- as in, when drawing one object, you can read data from up to 16 buffers.

The next object can use the same buffer(s), or a completely different set of 0-16 buffers.

Alright, thank you very much. It makes much more sense now.

For each of my game objects every frame I add an entry in a list of renderables. Renderables are just a structure storing information about the object, like its vertex/index buffers, materials, sorting parameters, etc. and every frame I iterate through the list and draw them one at a time, setting the vertex buffer for each one when I draw it.

This topic is closed to new replies.

Advertisement