batching
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>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement