   Proper way to render batches of d3dxmeshes
  In my D3D9 app I need to render maybe a few hundred D3DXMeshes every frame. Right now I'm just issuing a draw call for each mesh (rendersubset)...obviously this isn't optimal.My question is, how do you batch D3DXMESHES in a way that makes sense? Do you use instancing or add them all to a large vertex buffer or something?   
Quote:Original post by Matt AufderheideIn my D3D9 app I need to render maybe a few hundred D3DXMeshes every frame. Right now I'm just issuing a draw call for each mesh (rendersubset)...obviously this isn't optimal.How many hundred? The recommended maximum used to be 300 batches per frame with a 2GHz CPU, so I'd guess that 450 batches would be fine on a 3GHz CPU. Even if it's higher, have you profiled and found this is a problem?And why do you need to render so many meshes each frame? You'd definitely benifit more from higher level culling to reduce the number you have to render.Quote:Original post by Matt AufderheideMy question is, how do you batch D3DXMESHES in a way that makes sense? Do you use instancing or add them all to a large vertex buffer or something?You don't use ID3DXMesh [smile]. It's designed for ease of use, and it's pretty optimal, but it's always possible to do better.If your meshes are all the same then instancing may help, otherwise combining the VBs and IBs could be a reasonable option.   