How to increase the performance?
Hi,
I built (simulated) a simple scene of a commercial game, and I get:
- about 70fps in the commercial game
- about 40fps in my scene
Please, could you give me some hints about how to optimize the code? What are the most common "mistakes/slips" to provide low performance?
I’m using .x files (static meshes), .bmp e .tga (alpha) textures, flat reflections, point light…
Thanks.
Watch for redundant SetTexture calls or SetStreamSource calls. Use as view vertex buffers as possible, but don''t make one giant 40 megabyte vertex buffer. Always use indexed buffers. Use as few calls to DrawIndexedPrimitive as possible.
Those are the things you should keep in mind.
Now, about meshes. DrawSubset = inefficient. It calls SetStreamSource and SetIndices every time you call it so it is not the most efficient. If your data is static then you should retrieve the vertex/index buffers from the mesh interface and manage it yourself.
Those are the things you should keep in mind.
Now, about meshes. DrawSubset = inefficient. It calls SetStreamSource and SetIndices every time you call it so it is not the most efficient. If your data is static then you should retrieve the vertex/index buffers from the mesh interface and manage it yourself.
Thank you for your answer.
I''m using 3d studio max to create the .x files. Is it a good idea to generate a .x file composed by a lot of meshes or this decrease the performance? Could a complex texture mapping affect the performance? Are there rules to model a mesh to generate a optimized .x file?
Sorry by my English, OK?!
I''m using 3d studio max to create the .x files. Is it a good idea to generate a .x file composed by a lot of meshes or this decrease the performance? Could a complex texture mapping affect the performance? Are there rules to model a mesh to generate a optimized .x file?
Sorry by my English, OK?!
The less subsets you have in your mesh, the better. Unfortunately that''s all I can tell you . The mesh interface has an Optimize function which will reorder vertices into the most optimal position and connect vertices are the same but I doubt it will help much.
Raloth, thanks again.
Please, is there a simple procedure to retrieve the vertex/index buffers from my xfiles meshes (to apply DrawIndexedPrimitive method)? I never used this.
Please, is there a simple procedure to retrieve the vertex/index buffers from my xfiles meshes (to apply DrawIndexedPrimitive method)? I never used this.
use your own mesh class? its not that hard, and you can optimize the crap out of it compared to ID3DXMesh (that is what you are using right?)
you can allocate vertices from a big (static?) vertex buffer, you can batch renders easily, you can do loads of stuff that will speed it up.
you can allocate vertices from a big (static?) vertex buffer, you can batch renders easily, you can do loads of stuff that will speed it up.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement