Graphics Reference
In-Depth Information
deal with the large variance of camera conditions, close-ups with depth of field,
and hair rendering with other transparent materials and effects [Lacroix 13,Engel
and Hodes 13].
5.7.1 Constant Depth for Hair Pixels
Inthesamepassasthe Sort and Draw , when the fullscreen quad is drawn, the
quad may be drawn with a depth at the average depth or “hair object” position.
Because the stencil is used during the Sort and Draw pass, the depth writes can
be turned on and set to always pass and always write if the stencil comparison is
successful. This is the most relaxed approach with the smallest overhead. One
drawback is that depth is written for all hair pixels, even when hair is sparse,
and edge hair pixels have near zero alpha, which will appear almost completely
transparent. This drawback means the possibility for some noticeable visual
artifacts with depth-based effects. One such example is in depth of field, where
pixels that have nearly transparent hair fragments in them will not be blurred
into the background far-focus, and there will be a “transparent halo” artifact
around the hair. Another drawback is because of the lack of more precise depth
information for all hair pixels.
5.7.2 Depth Per Hair Pixel
In order to get depth data for all hair pixels, a separate render target may be used
during the Sort and Draw pass to capture the depth of the hair fragment in each
per-pixel linked list that is closest to the viewer. A second pass is needed after
this to copy the depth information collected into the depth buffer. The reason
for separating this into two passes, rather than writing the more precise depth in
the Sort and Draw pass, is because depth writes through the pixel shader are not
possible when the depth result is influenced by flow control in shader code. This
approach will result in more precise depth information per-pixel, but will still
suffer from the “transparent halo” problem previously described in Section 5.7.1.
5.7.3 Selective Depth Write
To deal with the “transparent halo” problem, this last depth writing solution
takes a conditional approach to writing depth, by evaluating final shaded hair
fragments during the Sort and Draw pass for opaque or near-opaque final hair
pixels. The criteria for evaluating pixels includes examining the number of hair
fragment layers and the final alpha value being used for blending. Pixels with a
large number of hair fragment layers or a large final alpha value can be marked
as opaque and have their precise depth captured and written in a second pass,
like the previously described depth writing solution.
Search WWH ::




Custom Search