Sign in to follow this  
Jess1997

How to draw multiple objects with Direct3D?

Recommended Posts

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?

Share this post


Link to post
Share on other sites


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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this