i
i
i
i
i
i
i
i
660 14. Acceleration Algorithms
Scene graphs themselves can be used to provide some computational
efficiency. A node in the scene graph often has a bounding volume (BV), and
is thus quite similar to a BVH. A leaf in the scene graph stores geometry.
However, one often allows this geometry to be encoded in any spatial data
structure that is desired. So, a leaf may hold an entire BSP tree that stores
the geometry of, say, a car.
It is important to realize that entirely unrelated efficiency schemes can
be used alongside a scene graph. This is the idea of spatialization,inwhich
the user’s scene graph is augmented with a separate data structure (e.g.,
BSP tree, BVH, etc.) created for a different task, such as faster culling or
picking. The leaf nodes, where most models are located, are shared, so the
expense of an additional spatial efficiency structure is relatively low.
Another idea related to scene graphs is the idea of a display list.In
OpenGL, objects are put into a special display list structure in order to
precompile them into a form more efficient to render. Objects in one node
in a scene graph can be put into a display list for convenience and speed.
14.2 Culling Techniques
To cull means to “remove from a flock,” and in the context of computer
graphics, this is exactly what culling techniques do. The flock is the whole
scene that we want to render, and the removal is limited to those portions
of the scene that are not considered to contribute to the final image. The
rest of the scene is sent through the rendering pipeline. Thus, the term visi-
bility culling is also often used in the context of rendering. However, culling
can also be done for other parts of a program. Examples include collision
detection (by doing less accurate computations for offscreen or hidden ob-
jects), physics computations, and AI. Here, only culling techniques related
to rendering will be presented. Examples of such techniques are backface
culling, view frustum culling,andocclusion culling. These are illustrated
in Figure 14.9. Backface culling eliminates polygons facing away from the
viewer. This is a simple technique that operates on only a single polygon
at a time. View frustum culling eliminates groups of polygons outside the
view frustum. As such, it is a little more complex. Occlusion culling elim-
inates objects hidden by groups of other objects. It is the most complex
culling technique, as it requires computing how objects affect each other.
The actual culling can theoretically take place at any stage of the ren-
dering pipeline, and for some occlusion culling algorithms, it can even be
precomputed. For culling algorithms that are implemented in hardware, we
can sometimes only enable/disable, or set some parameters for, the culling
function. For full control, the programmer can implement the algorithm in