Next: 16.3.2 Optimizing Transformations
Up: 16.3 Tuning the Geometry
Previous: 16.3 Tuning the Geometry
OpenGL offers many features that create sophisticated effects with excellent
performance. However, these features have some performance cost, compared to drawing
the same scene without them. Use these features only where their effects, performance,
and quality are justified.
- Turn off features when they are not required.
Once a feature has been turned on, it can slow the transform rate even when it
has no visible effect.
For example, the use of fog can slow the transform rate of polygons even when the
polygons are too close to show fog, and even when the fog density is set to zero.
For these conditions, turn off fog explicitly with glDisableGL_FOG(GL_FOG).
- Minimize mode changes.
Be especially careful about expensive mode changes such as changing glDepthRange()
parameters and changing fog parameters when fog is enabled.
- For optimum performance, use flat shading whenever possible.
This reduces the number of lighting computations from one per-vertex to one
per-primitive, and also reduces the amount of data that must be processed for each
primitive. This is particularly important for high-performance line drawing.
David Blythe
Thu Jul 17 21:24:28 PDT 1997