Anyway, the "Crayon Rule": the worst thing you can do for frame-rate in X-Plane is change textures.
The name comes from a conversation almost three years ago when Austin explained to Sergio the cost of changing textures like this: drawing in OpenGL is like drawing with a crayon. Changing textures is like going back and getting a different crayon. It's a lot faster to do all the red in your picture and not have to change between red and blue crayons all the time.
The crayon rule continues to hold true and it's understandable why:
- The texture you are using to draw is usually in VRAM. But the texture you are changing to could be in physical RAM (and must be transferred to the card), or worse it could have been paged out and must come from disk.
- The drawing pipeline must be stopped and reconfigured with the texture change.
- These things involve the host machine and CPU. Graphics cards are getting faster but CPUs are not - at least not much faster. So while the new graphics cards will be able to draw twice as many triangles, they will not be able to change textures twice as fast. In other words, we're stuck with the crayon rule for a long time.
So the big things you can do as an author to obey the crayon rule are:
- Use fewer large textures instead of many small ones.
- Group your polygons that use the panel texture together - switching to the panel texture is a crayon change.
No comments:
Post a Comment