O'Reilly logo

GPU PRO 3 by Wolfgang Engel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1
VI
Volumetric Transparency with
Per-Pixel Fragment Lists
L
´
aszl
´
o Sz
´
ecsi, P
´
al Barta, and Bal
´
azs Kov
´
acs
In this chapter we describe the volumetric transparency method for rendering
transparent objects that departs from classic alpha blending. Instead, it builds
per-pixel lists of surface fragments and evaluates illumination analytically be-
tween neighboring pairs. This new approach allows object transparency and
color to depend on material thickness, and transparent objects are allowed to
intersect. Thus, the method is geared at the most prevalent application of trans-
parency: particle system rendering, where it avoids all popping and clipping
artifacts characteristic of alpha-blended billboard clouds. We also show how tex-
turing, shadows, or light shafts can be added.
1.1 Introduction
In transparent objects and media, light interactions do not happen only on object
surfaces but also within its volume. Accurate computation of these, under general
conditions, requires costly ray-marching [Bunyk et al. 97,Szirmay-Kalos et al. 11]
or slicing [Ikits et al. 04] algorithms. These use, directly or indirectly, a large
number of point samples to find the color of each pixel. Thus, they can be
implemented most straightforwardly for voxel grid data; other representations
are usually converted to this.
A much more lightweight technique, alpha blending allows us to add trans-
parency to regular surface rasterization. However, it requires surface elements to
be rendered in a back-to-front order, does not instantly allow for transparency
to depend on object thickness, and works poorly with Z-testing. In the case of
particle systems rendered with transparent particle billboards, the most distress-
ing problems are addressed by spherical billboards [Umenhoffer et al. 06], also
called soft particles. This method uses pixel shaders to actually compute visible
thickness, clipped by opaque surfaces, and to adjust transparency and color ac-
323
324 VI GPGPU
cordingly. However, ordering of billboards is still required, and when the order
of the billboards changes between two animation frames, visible popping still oc-
curs. This is less pronounced if there are more particles, or if they appear similar.
However, in certain circumstances—for example, in fire-and-smoke scenarios, or
when shadows are cast onto the medium—particle colors and saturations may be
varied, and popping becomes more visible.
The megaparticles technique [Bahnassi and Bahnassi 06] eliminates billboard
artifacts, rendering actual spheres instead of billboards. This allows particles to
be shaded and depth-tested the same way as solid geometry. Their volumetric
nature is lost, but the effect can be reintroduced in an image-space distortion and
blurring pass. The technique can render stunningly shaded dense smoke, and,
with some sorting required, even solid objects are allowed to intersect. However,
mixing of low-opacity particles and proper depth-dependent transparency are
not addressed. Megaparticles and our volumetric transparency method share the
concept of using a few complex volumetric particles rather than thousands of
billboards.
The method of this chapter can be grasped both as a special case of ray
casting and a generalized case of alpha blending. From the ray-casting point of
view, what we do is assume a piecewise homogeneous medium and thus replace
costly point sampling with the evaluation of an analytic formula. Compared to
spherical billboards, our volumetric transparency method does not only clip the
volume thickness against opaque objects, but also accurately handles intersection
between particles. Mixing the two media together, it completely eliminates the
possibility of popping artifacts.
1.2 Light Transport Model
In rendering algorithms, we need to find radiance incoming at the eye along rays
through every pixel. Transparent objects and participating media exhibit volu-
metric lighting effects (see Figure 1.1): they let through some of the background
Figure 1.1. Volumetric lighting effects in participating media.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required