How to increase the performance?

Started by
7 comments, last by adriano_usp 20 years, 8 months ago
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.
Advertisement
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.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
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?!
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.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
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, does anybody have a answer for my last question?
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.
...please, could you show me any code?
return 0;

James Simmons
MindEngine Development
http://medev.sourceforge.net

This topic is closed to new replies.

Advertisement