Next | Prev | Up | Top | Contents | Index

Introduction to Multisampling

Multisampling works by sampling all primitives multiple times at different locations within each pixel, in effect collecting subpixel information. The result is an image that has fewer aliasing artifacts.

Because each sample includes depth and stencil information, the depth and stencil functions perform equivalently to the single-sample mode. A single pixel can have 4, 8, or 16 subsamples.

When you use multisampling and read back color, you get the resolved color value (that is, the average of the samples). When you read back stencil or depth, you typically get back a single sample value rather than the average; the sample value is typically the one closest to the center of the pixel.


When to Use Multisampling

Multisample antialiasing is most valuable for rendering polygons because it correctly handles adjacent polygons, object silhouettes, and even intersecting polygons. Each time a pixel is updated, the color sample values for each pixel are resolved to a single, displayable color.

For points and lines, the "smooth" antialiasing mechanism provided by standard OpenGL results in a higher-quality image and should be used instead (see "Antialiasing" in Chapter 7, "Blending, Antialiasing, and Fog," of the OpenGL Programming Guide).

The multisampling extension lets you alternate multisample and smooth antialiasing during the rendering of a single scene, so it's possible to mix multisampled polygons with smooth lines and points. See "Multisampled Points" and "Multisampled Lines" for more information.


Next | Prev | Up | Top | Contents | Index