batching

Started by
1 comment, last by SubUrban 21 years, 7 months ago
Hi! Everyone says batching is everything, but I''m not sure how to. Say I load 50 X files. I might have a class that loads the file and render it. In the Render function I loop through the meshes something like this: for(i=0;im_NumMaterials;i++) { m_Graphics->GetDeviceCOM()->SetMaterial(&Mesh->m_Materials); m_Graphics->GetDeviceCOM()->SetTexture(0, Mesh->m_Textures); m_Mesh->DrawSubset(i); } this doesn''t seem to batch but at all. I guess I should first sort the materials and textures and loop through that so I don''t need to set material and texture for every loop, but how should I batch more? </i>
Advertisement
I don''t think you can do much more here...
programmer
I guess I should look into GetAttributeTable.
But when I omptimize should I use D3DXMESHOPT_SHAREVB, D3DXMESHOPT_VERTEXCACHE, D3DXMESHOPT_IGNOREVERTS...the help doesn''t speak much of them.

This topic is closed to new replies.

Advertisement