Archived

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

keroz

Have Problem in SetTexture function?

Recommended Posts

I create and Render Mesh by ID3DXMesh and DrawSubset() numMesh = 120; for(int i=0;iSetTexture(0,texture); mesh[i].DrawSubset(0); } I set numMesh = 130 Speed is drop from 80 fps to 1 fps I think it happen becaus SetTexture function in for Loop if i want to set many Texture to many mesh in same screen how to manage it

Share this post


Link to post
Share on other sites
Yes, this is a very bad way to do things.

A much better way to do this is to sort your meshes by texture. Set the texture once for the meshes you are about to draw, then draw them, then change to the next texture and draw the meshes for that texture.

Share this post


Link to post
Share on other sites