Graphics Reference
In-Depth Information
Figure 3.76. An overhead view of how depth can be added to a billboard to allow proper depth testing.
discarded before any further processing. This reduces the overall computational cost of the
pipeline execution when there are many objects that overlap within a scene. The details
about how this is implemented vary by GPU manufacturer, so they will not be covered in
detail here. However, some of the assumptions made about the size of the geometry, which
are used during this hierarchical testing, occur prior to the execution of the pixel shader.
Therefore, when the depth value is modified in the pixel shader, Hi-Z may be unusable and
its performance benefits can be lost.
To allow Hi-Z to remain active for a certain subset of algorithms that require depth
output, Direct3D 11 introduces a new feature known as conservative depth output. This
technique works by requiring pixel shaders to specify an inequality function along with the
new depth value. The inequality effectively specifies an upper or lower bound on the depth
output, which allows Hi-Z to continue to identify fragments that can be trivially rejected
and thus don't require the pixel shader to be executed.
To have a pixel shader make use of conservative depth output, the shader program
must assign one of four new system value semantics to the value used for outputting depth.
These semantics each specify the inequality as part of the semantic name, and the depth
value must satisfy that inequality relative to the interpolated depth value calculated by the
rasterizer stage. If the pixel shader outputs a depth value that fails to satisfy the inequality,
the runtime will automatically clamp the value to the appropriate minimum or maximum
value. The four semantics are listed in Table 3.3.
Search WWH ::




Custom Search