How many (low poly) models can XNA handle?

前端 未结 2 1766
别那么骄傲
别那么骄傲 2021-01-05 13:08

I\'m aware that the following is a vague question, but I\'m hitting performance problems that I did not anticipate in XNA.

I have a low poly model (It has 18 faces a

2条回答
  •  死守一世寂寞
    2021-01-05 13:44

    As with any performance problem there are limits where a particular approach works. You need to measure and see where problems are. The best option is to use profiler but even basic measurements like looking at CPU load may show what bottlencks you have.

    As a first investiagtion step I'd recommend to remove all computations (like matrix multiplications) and see you get improvments - this would mean that CPU is still doing more work than GPU.

    Make sure you are not doing measurements on debug build - it could make application significantly slower if it is CPU bound.

    Side note: GPU works the best when you send large operations relatively infrequently. Your code does more or less opposite - send huge number of very small drawing requests. You should be able to batch your primitives and get better performance. There are samples around how to render large number of simple objects (including ones in DirectX SDK), searching for "gpu rendering crowds" can give you starting point.

提交回复
热议问题