Next: 18.3.2 Optimizing Transformations
Up: 18.3 Tuning the Geometry
Previous: 18.3 Tuning the Geometry
  Contents
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. When
the polygons are too close to show fog, or when the fog density is set to
zero, 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 of most software renderers and many hardware
renderers as well, use flat shading. 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. Keep in mind that
long triangle strips approach one vertex per primitive and may show little
benefit from flat shading.
Next: 18.3.2 Optimizing Transformations
Up: 18.3 Tuning the Geometry
Previous: 18.3 Tuning the Geometry
  Contents
2001-01-10