0

I'm fairly new to DirectX. I have what I think should be a pretty simple question, but I can't seem to find an answer to it anywhere.

Basically, I'd like to know how to add vertices from multiple meshes to a single vertex buffer. This would only happen once per mesh as the program is initialized, so I believe I want DEFAULT usage.

Is It possible to add each mesh to the buffer individually? or do I need to collect them all in a single array and pass them all at once? Default or Dynamic? Map/Unmap or updateSubresource? Thanks

For now I am using an index buffer and drawing once per object (horrible I know) but I am planning on switching to instancing as soon as I figure this out.

Camander
  • 147
  • 1
  • 10
  • You will need to submit a single Draw per 'material' in a mesh anyhow, so typically meshes have multiple draws per object. Combining VBs can be useful, but there's not a huge overhead for using one VB per mesh (although obviously not per instance of the mesh). It's likely not worth the extra overhead of doing it at loadtime anyhow. – Chuck Walbourn Sep 07 '15 at 06:28
  • Note that the ``StartIndex`` and ``BaseVertexIndex`` parameters are useful for this kind of combination. – Chuck Walbourn Sep 07 '15 at 06:28

0 Answers0