Behaviour
Description
Enumeration of special behaviour flags for values that are passed between shader stages.
The interpolation mode for a pixel shader input value is defined by the following flags:
-
If NoInterpolation is present, the value will not be interpolated. It will be copied from the provoking vertex instead.
-
Otherwise, if NoPerspective is present, interpolation without perspective correction will be applied to the value.
-
Otherwise, interpolation with perspective correction will be applied to the value.
The sampling mode for interpolated pixel shader input values can be controlled as follows:
-
If Sample is present, the pixel shader will run per sample and the value will be sampled at the respective sample location, which will always be inside the graphics primitive.
-
If Centroid is present and Center is absent, the value will be sampled at an unspecified location (chosen by the GPU) that is inside the graphics primitive.
-
Otherwise, the value will be sampled at the pixel center, which might lie be outside the graphics primitive.
- See also
Public / Constants
Centroid
Use centroid sampling instead of pixel-center sampling when running at pixel frequency and if Center is not present.
When using multi-sampling at pixel frequency, the pixel shader is executed only once and its output is copied to those samples that lie within the current graphics primitive. It is possible that one or more samples are within the primitive while the pixel center is on the outside. In that case, the pixel shader receives extrapolated input data, which does not necessarily lie within expected value ranges. With centroid sampling, input data is guaranteed to have been computed for a location within the pixel that is inside the primitive, chosen by the GPU. Since centroid locations of neighbouring pixels may be chosen arbitrarily by the GPU, derivatives usually become highly inaccurate. In a nutshell, Centroid should be used according to these rules:
- See also
Center
Force pixel-center sampling when running at pixel frequency, even if Centroid is present.
- See also