i
i
i
i
i
i
i
i
2. Order-Independent Transparency using Per-Pixel Linked Lists 411
buffer. The programmer is given control of the counter via the following two
Shader Model 5.0 methods:
u i n t <Buf fe r >. IncrementCoun t er ( ) ;
u i n t <Buf fe r >. DecrementCounter ( ) ;
Hardware counter support is used to keep track of the offset at which to store
the next linked list node.
While hardware counter support is not strictly required for the algorithm to
work, it enables considerable performance improvement compared to manually
keeping track of a counter via a single-element buffer UAV.
2.3.4 Early Depth/Stencil Rejection
Graphics APIs like OpenGL and Direct3D specify that the depth/stencil test
be executed after the pixel shader stage in the graphics pipeline. A problem
arises when the pixel shader outputs to UAVs because UAVs may be written
into the shader even though the subsequent depth/stencil test actually discards
the pixel, which may not be the intended behavior of the algorithm. Shader
Model 5.0 allows the [earlydepthstencil] keyword to be declared in front of
a pixel shader function to indicate that the depth/stencil test is to be explicitly
performed before the pixel shader stage, allowing UAV writes to be carried out
only if the depth/ stencil test succeeds first. This functionality is important for
the algorithm presented in this chapter, since only visible translucent fragments
need storing into the per-pixel linked lists.
2.3.5 SV COVERAGE Pixel Shader Input
DirectX 11 allows SV COVERAGE to be declared as an input to the pixel shader
stage. SV COVERAGE contains a bit mask of all samples that are covered by the
current primitive. This information is used by this OIT technique when multi-
sampling antialiasing (MSAA) is enabled.
2.3.6 Per-sample Pixel Shader Execution
DirectX 11 allows the pixel shader stage to execute per sample (as opposed to
per pixel) when MSAA is enabled. This functionality will be exploited to allow
MSAA support with our OIT technique.
2.4 Head Pointer and Nodes Buffers
The algorithm builds a reverse linked list for each pixel location in the target
viewport. The linked list head pointer is the address of the first element in the