i
i
i
i
i
i
i
i
396 9. Global Illumination
9.5 Refractions
For simple transmittance, we assume that the incoming light comes from
directly beyond the transmitter. This is a reasonable assumption when the
front and back surfaces of the transmitter are parallel and the thickness
is not great, e.g., for a pane of glass. For other transparent media, the
index of refraction plays an important part. Snell’s Law, which describes
how light changes direction when a transmitter’s surface is encountered, is
described in Section 7.5.3.
Bec [78] presents an efficient method of computing the refraction vector.
For readability (because n is traditionally used for the index of refraction
in Snell’s equation), define N as the surface normal and L as the direction
to the light:
t =(w − k)N − nL, (9.31)
where n = n
1
/n
2
is the relative index of refraction, and
w = n(L · N),
k =
1+(w −n)(w + n).
(9.32)
The resulting refraction vector t is returned normalized.
This evaluation can nonetheless be expensive. Oliveira [962] notes that
because the contribution of refraction drops off near the horizon, an ap-
proximation for incoming angles near the normal direction is
t = −cN − L, (9.33)
where c is somewhere around 1.0 for simulating water. Note that the
resulting vector t needs to be normalized when using this formula.
The index of refraction varies with wavelength. That is, a transpar-
ent medium will bend different colors of light at different angles. This
phenomenon is called dispersion, and explains why prisms work and why
rainbows occur. Dispersion can cause a problem in lenses, called chromatic
aberration. In photography, this phenomenon is called purple fringing,and
can be particularly noticeable along high contrast edges in daylight. In
computer graphics we normally ignore this effect, as it is usually an arti-
fact to be avoided. Additional computation is needed to properly simulate
the effect, as each light ray entering a transparent surface generates a set
of light rays that must then be tracked. As such, normally a single re-
fracted ray is used. In practical terms, water has an index of refraction of
approximately 1.33, glass typically around 1.5, and air essentially 1.0.
Some techniques for simulating refraction are somewhat comparable to
those of reflection. However, for refraction through a planar surface, it is
not as straightforward as just moving the viewpoint. Diefenbach [252] dis-
cusses this problem in depth, noting that a homogeneous transform matrix