Thursday, August 17, 2006

Avoid thrashing pavement types in apt.dat files

In the distant past I blogged about the "crayon rule", that is, thet importance of not changing textures a lot during rendering, and how authors can help X-Plane avoid changing textures.

Before X-Plane 8.50 the sim would change textures every time the pavement changed types in an apt.dat file. So if you have an airport layout that alternates concrete and asphalt pavement (the order in the apt.dat file is the drawing order!) then X-Plane would just switch and switch.

X-Plane 8.50 tries to be smarter about this and detect when it can get away with changing your layout order to reduce texture changes, improving framerate.

Here's my warning: X-Plane is not very smart about this! We try to eliminate unneeded changes but our code isn't that elaborate and it won't optimize as well as you can.

The sure-fire way to improve framerate is to group your layouts by pavement type. This will give you the best framerate. If you have to overlap pavement and control the draw order, I recommend using as few groups of pavement types as possible.

No comments: