Batching D3DX meshes

Started by
2 comments, last by Matt Aufderheide 18 years ago
In my d3d engine i am using serveal hundred meshes for grass rendering. I dynamically reposition the meshes based on distance to camera. This way i can have apparently continuous fields of grass without using millions of models. But I am wondering if there is a way to optimize this further by batching all these meshes together and draw them all with one draw call. Is there an efficient way to batch D3DX Meshes? It seem I could use D3DXConcatenateMesh, but this seems like it is slow, plus i dont get the expected results. Is the best method? or is there a better way? Or is it just too much of a pain to batch meshes that are going to be moved around dynamically?
Advertisement
Sounds like you want hardware instancing.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Yes this could work, thanks... I'll look into it.
Hmm, does anyone have any pointers on how to use D3DX Meshes with instancing mehtods? It seems D3DX has no interface native for this purpose, and i have to convert meshes to index buffers..

This topic is closed to new replies.

Advertisement