i
i
i
i
i
i
i
i
398 9. Global Illumination
Figure 9.50. On the left, the transmitter refracts both nearby objects and the surrounding
skybox [1386]. On the right, caustics are generated via hierarchical maps similar in
nature to shadow maps [1388]. (Images courtesy of Chris Wyman, University of Iowa.)
backface texel is found where the ray exits, the backface’s data at that point
properly refracts the ray, which is then used to access the environment map.
The hard part is to find this backface pixel. The procedure they use to trace
the rays is in the spirit of relief mapping (Section 6.7.4). The backface z-
depths are treated like a heightfield, and each ray walks through this buffer
until an intersection is found. Depth peeling can be used for multiple
refractions. The main drawback is that total internal reflection cannot be
handled. Using Heckbert’s regular expression notation [519], described at
the beginning of this chapter, the paths simulated are then L(D|S)SSE:
The eye sees a refractive surface, a backface then also refracts as the ray
leaves, and some surface in an environment map is then seen through the
transmitter.
Davis and Wyman [229] take this relief mapping approach a step farther,
storing both back and frontfaces as separate heightfield textures. Nearby
objects behind the transparent object can be converted into color and depth
maps so that the refracted rays treat these as local objects. An example
is shown in Figure 9.50. In addition, rays can have multiple bounces, and
total internal reflection can be handled. This gives a refractive light path of
L(D|S)S + SE. A limitation of all of these image-space refraction schemes
is that if a part of the model is rendered offscreen, the clipped data cannot
refract (since it does not exist).
Simpler forms of refraction ray tracing can be used directly for basic
geometric objects. For example, Vlachos and Mitchell [1303] generate the
refraction ray and use ray tracing in a pixel shader program to find which
wall of the water’s container is hit. See Figure 9.51.