i
i
i
i
i
i
i
i
9.2. Ambient Occlusion 385
A simpler (and cheaper) approach that is also based on screen-space
analysis of the contents of the Z-buffer was proposed by Luft et al. [802].
The basic idea is to perform an unsharp mask filter on the Z-buffer. An
unsharp mask is a type of high-pass filter that accentuates edges and other
discontinuities in an image. It does so by subtracting a blurred version
from the original image. This method is inexpensive. The result only
superficially resembles ambient occlusion, but with some adjustment of
scale factors, a pleasing image can be produced—see Figure 9.40.
Shanmugam and Arikan [1156] describe two approaches in their paper.
One generates fine ambient occlusion from small, nearby details. The other
generates coarse ambient occlusion from larger objects. The results of the
two are combined to produce the final ambient occlusion factor.
Their fine ambient occlusion method uses a full screen pass that accesses
the Z-buffer along with a second buffer containing the surface normals of
the visible pixels. For each shaded pixel, nearby pixels are sampled from the
Z-buffer. The sampled pixels are represented as spheres, and an occlusion
term is computed for the shaded pixel (taking its normal into account).
Double shadowing is not accounted for, so the result is somewhat dark.
Their coarse occlusion method is similar to the object-space method of
Ren et al. [1062] (discussed on page 381) in that the occluding geometry is
approximated as a collection of spheres. However, Shanmugam and Arikan
accumulate occlusion in screen space, using screen-aligned billboards cov-
ering the “area of effect” of each occluding sphere. Double shadowing is
also not accounted for in the coarse occlusion method either (unlike the
method of Ren et al.).
Sloan et al. [1190] propose a technique that combines the spherical har-
monic exponentiation of Ren et al. [1062] with the screen-space occlusion
approach of Shanmugam and Arikan [1156]. As in the technique by Ren et
al., spherical harmonic visibility functions from spherical occluders are ac-
cumulated in log space, and the result is exponentiated. As in Shanmugam
and Arikan’s technique, these accumulations occur in screen space (in this
case by rendering coarsely tessellated spheres rather than billboards). The
combined technique by Sloan et al. accounts for double shadowing and can
produce not only ambient occlusion factors and bent normals, but also
higher-frequency visibility functions that can be used to shadow environ-
mentmapsandarealights. Itcanevenhandle interreflections. However,
it is limited to coarse occlusion, since it uses spherical proxies instead of
the actual occluding geometry.
One interesting option is to replace Shanmugam and Arikan’s fine occlu-
sion method [1156] with the less expensive Crytek method [887], to improve
performance while retaining both coarse and fine occlusion. Alternatively,
their coarse method could be replaced with the more accurate one proposed
by Sloan et al. [1190], to improve visual quality.