Graphics Reference
In-Depth Information
Pixel
Fragment
Primitive
(Triangle)
Sample
Figure 36.20: A pixel is a rectangular region of the framebuffer. A primitive is the geometric
shape to be rendered, such as a triangle. A fragment is the portion of a primitive that lies
within a pixel. A sample is a point within a pixel. Coverage and shading are computed at
samples (although possibly not at the same samples). The color of a pixel is determined by
a resolve operation that filters nearby samples, for example, averaging all sample values
within a pixel.
The easiest way to convert a renderer built for one sample per pixel to approx-
imate the integral of incident radiance across its area is to numerically integrate
by taking many samples. This is the strategy employed by many algorithms.
Supersampled antialiasing (SSAA) computes binary visibility for each sam-
ple. Those samples at which visibility is one for a given fragment are then shaded
independently. A single fragment may produce a different shade at each sample
within a pixel. The final supersampled framebuffer is resolved to a one-value-per-
pixel image by averaging all samples that lie within each pixel.
There are several advantages to SSAA. Increasing the sample count auto-
matically increases the sampling of geometry, materials, lighting, and any other
inputs to the shading computation. This aliasing arising from many sources can
be addressed using a single algorithm. Implementing SSAA is very simple, and
using it is intuitive and yields predictable results. One way to implement SSAA on
a renderer that does not natively support it is to use an accumulation buffer. The
accumulation buffer allows rendering in multiple one-sample-per-pixel passes and
averaging the results of all passes. If each pass is rendered with a different subpixel
offset, the net result is identical to that created using multiple samples within each
pixel. The accumulation buffer implementation reduces the peak memory require-
ment of the framebuffer but increases the cost of transforming and rasterizing
geometry.
The primary drawback of SSAA is that computing N samples per pixel is typi-
cally N times more expensive than computing a single sample per pixel, yet it may
be unnecessary. In many situations, the shading result arising from illumination
and materials either varies more slowly across a primitive than between primitives,
Figure 36.21: The triangle has
binary visibility 1 on the pix-
els marked with solid blue and
0 on the pixels that are white.
A binary value cannot accurately
represent the triangle's visibility
on the pixels along the triangle's
slanted sides that are marked in
light green. Attempting to com-
pute binary visibility at those pix-
els necessarily produces aliasing.
 
 
Search WWH ::




Custom Search