next up previous
Next: Pipelining and Parallelism Up: Hardware for OpenGL Previous: Per-fragment Operations

Transforming Geometry

Vertices for OpenGL polygons, lines, and other rendering primitives are specified in object coordinates. These coordinates and other parameters like surface normals and colors are typically manipulated internally to OpenGL as floating point values. OpenGL does permit a wide variety of input formats so conversion to the OpenGL implementation's internal format may be necessary. Once converted, taking the colors, normals, vertices, and other parameters and converting these to primitives in window coordinates is the purpose of the transformation stage.

  
Table 2: Floating point operations required to transform a single vertex using single-source lighting.

Like rasterization, transformation can be broken into several sub-stages:

Modeling transformation.
Object coordinates are converted to eye coordinates using OpenGL's current modelview matrix. Surface normals are also transformed and possibly normalized. This sub-stage maintains the modelview matrix stack.

Lighting calculations.
If lighting is enabled, OpenGL performs per-vertex lighting calculations based on various lighting parameters.

Projection transformation.
Eye coordinates are converted to clip coordinates using OpenGL's current projection matrix.

Clip testing.
Primitives are clipped to the current clip volume. Additionally, OpenGL allows specifying user-defined clip planes.

Perspective division.
To maintain correct 3D perspective, OpenGL manipulates homogenous coordinates (meaning a 3D coordinate is represented as 4 floating point values: x, y, z, and w). This requires x, y, and z to each be divided by w to homogenize the result into a standard (x, y, z) form.

Viewport transformation.
Finally, the vertex coordinates must be converted to window space based on the viewport.

These sub-stages are computationally intensive and repeated for every vertex that is transformed. The number of floating point operations required to transform a single 3D vertex lit by a single simple light source is roughly 100. See Table 2 for a breakdown. This means rendering a scene 30 times a second consisting of 10,000 triangles would require approximately 90 million floating point operations per second () just to transform the geometry. Off-loading geometry transformation from the host processor and into specialized graphics hardware makes good sense for applications that demand very high polygon rendering rates.

  
Figure 6: a) portrays a pipelined architecture with four stages; b) portrays a parallel architecture with four tasks.





next up previous
Next: Pipelining and Parallelism Up: Hardware for OpenGL Previous: Per-fragment Operations



mjk@sgi.com