Graphics Reference
In-Depth Information
These effects have always been challenging for real-time rasterization. When
the scene geometry is rasterized, each triangle generates a number of fragments .
Each fragment corresponds to a screen pixel. It is a small surface element po-
tentially visible through this pixel. In a classical rasterizer only the fragment
closest to the viewer is kept: the rasterizer blindly rejects all fragments that are
farther away than the current closest, using the Z-buffer algorithm. Instead, al-
gorithms dealing with transparency or CSG have to produce ordered lists of all
the fragments falling into each pixel. This is typically performed in two stages:
First, a list of fragments is gathered for each pixel. Second, the lists are sorted
by depth and rendering is performed by traversing the lists, either accumulat-
ing opacity and colors (for transparency effects), or applying boolean operations
to determine which fragment is visible (for rendering a CSG model). The data
structure is recreated at every frame, and therefore has to be extremely ecient
and integrate well with the rasterizer.
A large body of work has been dedicated to this problem. Most techniques
for fragment accumulation implement a form of A-buffer [Carpenter 84]. The
A-buffer stores in each pixel the list of fragments that cover that pixel. The frag-
ments are sorted by depth and the size of the list is called the depth-complexity ,
as visualized in Figure 1.3 (top-right). For a review of A-buffer techniques for
transparency we refer the reader to the survey by Maule et al. [Maule et al. 11].
In this chapter we introduce and compare four different techniques to build
and render from an A-buffer in real time. One of these techniques is well known
while the others are, to the best of our knowledge, novel. We focus on scenes
with moderate or sparse depth complexity; the techniques presented here will not
scale well on extreme transparency scenarios. In exchange, their implementation
is simple and they integrate directly in the graphics API; a compute API is not
necessary. All our techniques build the A-buffer in a single geometry pass: the
scene geometry is rasterized once per frame.
A drawback of storing the fragments first and sorting them later is that some
fragments may in fact be unnecessary: in a transparency application the opacity
of the fragments may accumulate up to a point where anything located behind
makes no contribution to the final image. Two of the techniques proposed here
afford for a conservative early-culling mechanism: inserted fragments are always
sorted in memory, enabling detection of opaque accumulation.
The companion code includes a full implementation and benchmarking frame-
work.
1.1.1 Overview
An A-buffer stores a list of fragments for each pixel. Sorting them by increasing
or decreasing depth are both possible. However, the sorting technique that we
describe in Section 1.3 is easier to explain and implement for decreasing values
as we walk along the list. Adding to that, early culling of negligible fragments
Search WWH ::




Custom Search