Friday, June 19, 2009

Optimization By Check-Boxes

In the next X-Plane 930 beta (it should post today I think) the rendering settings have two new check-boxes: one to enable the "dynamic" airplane shadow and one to enable per-pixel lighting.

In the last week a number of users emailed me performance numbers via the fps test, and from what I can tell, 99% of performance problems can be attributed to these two new features chewing up resources in a way that 922 did not. When the features are both disabled, from what I can tell, the sim should be as fast or faster than 922.

The new beta will also limits dynamic shadows to your aircraft - beta 13 will calculate a dynamic shadow for every aircraft, which is unacceptably slow when you have a lot of AI planes enabled.

I may still be able to improve the performance of the per-pixel-lighting shader, but fundamentally per-pixel lighting is going to be more expensive than per vertex. The average X-Plane scene might have 200,000 to 500,000 vertices. At absolute minimum resolution, no FSAA, you're going to have over 700,000 pixels even if there is no "over-draw" - you could easily have 10x that fill rate with only a modest increase in overdraw, full-screen anti-aliasing and window size. Simply put, per-pixel lighting is more work.

Please bear in mind: without per-pixel lighting X-Plane's pixel shader is extremely simple. If you have a "low-end" card this could give you the illusion of GPU power when there is really not much under the hood.

Examples of low-end cards: GeForce 7300, GeForce 8400, GeForce 9400, Radeon X300, Radeon X1300, Radeon HD2400. All of these cards are the younger brother of a fairly capable card, but with fewer pixel shader units/cores. If each unit is doing very little work, you don't need that much pixel-filling power...but when we go to a "real" shader, the difference between a GeForce 8400 and 8800 becomes very, very apparent. Simply put, even with optimization the GeForce 7300 (for example) will never run a huge monitor with per pixel lighting and high FSAA.

3 comments:

Anonymous said...

Performance when it's raining still isn't the same as 9.22
It's very slow with rain using 9.30 beta, with the same machine and same options.

Benjamin Supnik said...

File a bug. Include:

fps-test -- use fps_test 1 and fps_test 41, for both 922 and 930...in other words, 4 fps test runs comparing v930b14 an v922rc1.

Send the logs for all 4.

Mark the bug as "For me".

Bukan Lagi said...

Beta testers (of which I am not one) also report that cloud puff adjustment has been removed, if I'm interpreting their screams correctly.

In the interest of more user-adjustable settings and not fewer (which I thought you've been on-board with generally), will these also be put back in?