Graphics Reference
In-Depth Information
Figure 3.65. Rasterization sample points for non-MSAA and MSAA Rendering.
occurs when a continuous signal isn't sampled at a high enough sampling frequency to re-
produce the original signal. If we were to describe rasterization in such terms, the "signal"
would be the vector representation of our 3D geometry, while our "sampling frequency" is
the
X
and
Y
resolution of the render target. In more general terms, we can say that aliasing
occurs because our geometry must ultimately be rendered to a discrete grid of rectangles,
using a binary coverage test. A grid of rectangles can never perfectly represent edges that
are not completely horizontal or vertical, so a jagged "stair step" pattern occurs. This type
of aliasing artifact is often referred to as
edge aliasing,
since it occurs at triangle edges.
Another type of aliasing results from the fact that a pixel shader is only executed once for
each pixel, thus discretely sampling the surface color resulting from the material and BRDF
properties. This type of aliasing is referred to as
shader aliasing.
These artifacts can be very
displeasing to the eye if the resolution of the image is small relative to the size of the display.
The classic signal processing approach to combat aliasing is to sample at a higher
frequency, and then apply a low-pass filter. In rasterization, this roughly equates to render-
ing to a higher-resolution render target, averaging adjacent pixels, and using the result of
the average as the pixel values for a normal-sized render target. In real time 3D graph-
ics, this process is referred to as
super sampling anti-aliasing,
or
SSAA.
Increasing the
resolution increases the sampling frequency used for both rasterization and pixel shading,
thus effectively reducing the appearance of both types of aliasing. However, the additional
performance cost of doubling or quadrupling the render target resolution often makes the
technique prohibitively expensive. Because of this, Direct3D 11 includes a more simplified
and optimized form of anti-aliasing known as
multisample anti-aliasing (MSAA).
The basic premise of MSAA is that the resolution used for rasterization and the depth/
stencil test is increased by an integral factor, but the pixel shader is still executed at the
normal resolution of the render target. This allows it to effectively deal with edge aliasing,
but not with shader aliasing. Since the depth and stencil tests are performed at a higher
resolution, the depth-stencil buffer must store multiple subsamples per-pixel, causing the
Search WWH ::
Custom Search