DirectX11: Drawing multiple objects

How can I draw many different objects on screen at once, with multiple vertex buffers, using DrawIndexed() ? (Drawing the same object is simple, and I'm not looking to instance) . but I am looking to transform two different vertex buffers. (Yes I am using indexed vertices)

asked Feb 6, 2014 at 1:16 Rashid Ellis Rashid Ellis 23 1 1 silver badge 7 7 bronze badges

2 Answers 2

\$\begingroup\$

You can bind multiple vertex buffers at once. However, unless you use instancing or similar (passing transform data in a constant buffer, for example, which becomes cumbersome beyond a certain number of objects and which is effectively the same as instancing anyway), all the buffers bound at a given draw call share the same bound transformation.

In other words, your options are:

answered Feb 6, 2014 at 1:47 user1430 user1430

\$\begingroup\$ I didn't want to instance because the content of each vertex buffer was different. It was something simpler than the draw calls. I'm unsure how to refer to individual (indexed) vertex data in the index buffer. If I need to of course. and also confuzzled about how to wrap the data in a class for transforms. I thought about the cpu option, but my storage structures were in the heap and transforms would be called every single frame -or updated when changed. and it defeats the use of the GPU. :P \$\endgroup\$