Next | Prev | Up | Top | Contents | Index

The Polygon Offset Extension

The polygon offset extension, EXT_polygon_offset, is useful for rendering hidden-line images, rendering solids with highlighted edges, and applying decals to surfaces.

The extension is useful, for example, when you want to render outlines on surfaces. The lines are not rasterized the same way the polygons are. This results in slightly different depth values which, when used by the depth buffering mechanism, cause some of the line pixels to show, and some not to show. This is because triangles and lines produce different depth values and the system cannot tell ahead of time what will be in front. The extension offsets polygon pixels in the depth buffer so that lines and points no longer interact in that way, resulting in clean polygon outlines.

Using the extension, you can displace the depth values of fragments generated by rendering polygons by a fixed bias plus an amount. The amount is proportional to the maximum absolute value of the depth slope of the polygon, measured and applied in window coordinates. This displacement


Polygon Offset Example Program
New Functions

Next | Prev | Up | Top | Contents | Index