Direct3D10.1Features:sample-frequency
(2023-03-15 23:12:12)
标签:
it |
分类: 技术 |
Multisample Anti-Aliasing - Multisampling has been enhanced to
generalize coverage based transparency and make
multisampling work more effectively with multi-pass
rendering.
* To achieve this, all multisample semantics are defined as if
the pixel shader always runs once per sample
(sample-frequency), computing a separate color per
sample.
* If a pixel shader doesn't use any per-sample
attributes, then it will compute the same value for each
covered sample in a pixel.
- In that case, it is equivalent to the hardware executing the
shader once per pixel (pixel-frequency), replicating the
result to all covered samples. Naturally, running at
pixel-frequency always produces the same results as running the
same shader at sample-frequency, when the attributes are sampled
at a pixel-frequency.
- The PSInvocations pipeline statistic increments at
sample-frequency unless the shader is running at
pixel-frequency.
Rasterization Rules - The rules for rasterization have changed
for lines, in addition, new functionality has been added.
MultisampleEnable only affects line rasterization (points and
triangles are unaffected), and is used to choose a line drawing
algorithm. This means that some multisample rasterization from
Direct3D 10 are no longer supported.
New sample-frequency pixel shader execution with
primitive rasterization.
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-to-get-sample-position
A pixel shader can be evaluated at sample frequency
(run a pixel shader once per sample) or at pixel frequency
(run a pixel shader once per pixel).
Attach the SV_SampleIndex semantic to a pixel shader
input to invoke a pixel shader at sample frequency, the
input value is then used as a sample index when sampling the
render target.
You can interpolate a pixel shader input in several ways. To
interpolate at:
A pixel center, don't use any semantic.
A sample, use the SV_SampleIndex semantic.
A centroid location, use the _centroid modifier.