Have Problem in SetTexture function?

Started by
2 comments, last by keroz 20 years, 2 months ago
I create and Render Mesh by ID3DXMesh and DrawSubset() numMesh = 120; for(int i=0;iSetTexture(0,texture); mesh.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 </i>
Advertisement
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.
Tank you But,
what is best way for set texture by DirectX ?

SetTexture() is the only way to set textures using DirectX. There is no faster way (at least on windows platforms).

This topic is closed to new replies.

Advertisement