Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to draw multiple objects with Direct3D?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Jess1997   Members   -  Reputation: 101

Like
0Likes
Like

Posted 17 August 2014 - 11:16 PM

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?



Sponsor:

#2 Hodgman   Moderators   -  Reputation: 30385

Like
4Likes
Like

Posted 17 August 2014 - 11:21 PM


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.



#3 Jess1997   Members   -  Reputation: 101

Like
0Likes
Like

Posted 17 August 2014 - 11:32 PM

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



#4 3DModelerMan   Members   -  Reputation: 1004

Like
0Likes
Like

Posted 18 August 2014 - 03:23 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS