Graphics Reference
In-Depth Information
of visibility determination should be in such a situation because it does not corre-
spond to a physically plausible scene. If an object is composed of a material that
transmits light, then a geometric “visibility” test does not correspond to a light
transport visibility test.
If we abuse geometric visibility in this case and apply backface culling, the
back surface will disappear. In practice one can model a transmissive object with
coincident and oppositely oriented surfaces. For example, a glass ball consists of
a spherical air-glass interface oriented outward from the center of the ball and a
glass-air interface oriented inward. Backface culling remains conservative under
this model. Along a path that does not experience total internal refraction, light
originating outside the ball first interacts with an air-glass frontface to enter the
ball and then with a glass-air frontface to exit again, as shown in Figure 36.18.
Air-glass
interface
Glass-air
interface
Air
Glass
Air
Figure 36.18: Backface culling
allows a ray to intersect the cor-
rect one of the two coincident air-
glass and glass-air interfaces of a
glass ball surrounded by air.
36.7 Hierarchical Occlusion Culling
If no part of a box is visible from a point Q that is outside of the box, and if the
box is replaced with some new object that fits inside it, then no part of that object
can possibly be visible either. This observation holds for any shape, not just a box.
This is the key idea of occlusion culling. It seeks to conservatively identify that
a complex object is not visible by proving that a geometrically simpler bounding
volume around the object is also not visible. It is an excellent strategy for efficient
conservative visibility determination on dynamic scenes.
How much simpler should the bounding volume be? If it is too simple, then
it may be much larger than the original object and will generate too many false-
positive results (i.e., the bounding volume will often be visible even when the
actual object is not). If it is too complex, then we gain little net efficiency even
if it is a good predictor. The natural solution is to divide and conquer. Create a
Bounding Volume Hierarchy ( BVH ; see Chapter 37) and walk its tree. If a node
is not visible, then all of its children must not be visible. This is one form of
hierarchical occlusion culling.
A ray tracer with a hierarchical spatial data structure effectively performs
occlusion culling, although the term is not typically applied to that case. For
example, a ray cast through a BVH corresponds exactly to the algorithm from
the previous paragraph.
For rasterization, occlusion culling is only useful if we can test visibility for
the bounding volumes substantially faster than we can for the primitives them-
selves. There are two implementation strategies, commonly built directly into ras-
terization hardware, that support this.
The first is a special rasterization operation called an occlusion query [Sek04]
that invokes no shading or changes to the depth buffer. Its only output is a count
of the number of samples that would have passed the depth buffer visibility test.
It can be substantially faster than full rasterization because it requires no output
bandwidth to the framebuffer and no synchronous access to the depth buffer for
updates, interpolates no attributes except depth, and launches no shading opera-
tions. Chapter 38 shows that those are often the expensive operations in rasteriza-
tion, so eliminating them decreases the cost of rasterization substantially.
Occlusion culling with an occlusion query issues several queries asyn-
chronously from the main rendering thread. When the result of a query is avail-
able, it then renders the corresponding object if and only if one or more pixels
 
 
Search WWH ::




Custom Search