Graphics Reference
In-Depth Information
Figure 3.71. Interpolation point for centroid sampling.
partially covered by a primitive and MSAA is enabled, the rasterizer will produce a frag-
ment for that pixel. However, if the primitive only covers a few samples within the pixel,
but not the center of the pixel, then the normal linear interpolation mode would still use
the center of the pixel as the input location to the interpolation function. Because of this, it
is possible for the vertex attributes to be extrapolated beyond the true edge of the triangle,
in cases in which only a portion of the sample positions are covered. For situations where
extrapolation is undesirable, centroid sampling can be used on a per-attribute basis by
adding the centroid modifier to the input variable declaration. When it is used, centroid
sampling causes the affected attribute to be interpolated to a point that is guaranteed to
be covered by the triangle. The location used is implementation-specific, but is generally
located at the average of the covered sample points. An example of the centroid sampling
mode is shown in Figure 3.71.
The sample mode . The sample interpolation mode provides interpolation at each of the
sample points used in MSAA rendering mode. This is useful when the pixel shader is ex-
ecuted for each MSAA sample to provide attributes at each individual sample location. The
topic of MSAA and how it relates to the pixel shader is discussed further in the following
section.
Multisample Anti-Aliasing
Several additional system value semantics can be declared as inputs to the pixel shader to
offer some interesting possibilities for controlling its behavior when MSAA is enabled.
Direct3D 11 offers several ways in which the "standard" MSAA behavior can be altered.
These changes are based on the pixel shader bound to the pipeline, and on how it declares
its input and output attributes.
Search WWH ::




Custom Search