Archived

This topic is now archived and is closed to further replies.

batching

This topic is 5585 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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[i]); 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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites