i
i
i
i
i
i
i
i
666 14. Acceleration Algorithms
perform the more accurate (though more expensive) box/frustum test if
this box is known to be much smaller than the sphere [1145].
A useful optimization for the “intersects frustum” case is to keep track of
which frustum planes the BV is fully inside [89]. This information, usually
stored as a bitmask, can then be passed with the intersector for testing
children of this BV. Only those planes that intersected the BV need to be
tested against the children. In this way, the root BV will be tested against
6 frustum planes, but as BVs come into view the number of plane/BV tests
done at each child will go down.
View frustum culling operates in the application stage (CPU), which
means that the load on the GPU can often be dramatically reduced. For
large scenes or certain camera views, only a fraction of the scene might
be visible, and it is only this fraction that needs to be sent through the
rendering pipeline. In such cases a large gain in speed can be expected.
View frustum culling techniques exploit the spatial coherence in a scene,
since objects that are located near each other can be enclosed in a BV, and
nearby BVs may be clustered hierarchically.
Other spatial data structures than the BVH can also be used for view
frustum culling. This includes octrees and Binary Space Partitioning (BSP)
trees [1099]. These methods are usually not flexible enough when it comes
to rendering dynamic scenes. That is, it takes too long to update the
corresponding data structures when an object stored in the structure moves
(an exception is loose octrees). But for static scenes, these methods can
perform better than BVHs. Hybrid methods can also be used, e.g., using
BVs to tightly bound the contents of octree nodes. Another approach is to
keep separate structures for static versus dynamic objects.
Polygon-aligned BSP trees are simple to use for view frustum culling. If
the box containing the scene is visible, then the root node’s splitting plane
is tested. If the plane intersects the frustum (i.e., if two corners on the
frustum are found to be on opposite sides of the plane [see Section 16.10]),
then both branches of the BSP tree are traversed. If instead, the view
frustum is fully on one side of the plane, then whatever is on the other
side of the plane is culled. Axis-aligned BSP trees and octrees are also
simple to use. Traverse the tree from the root, and test each box in the
tree during traversal. If a box is outside the frustum, traversal for that
branch is terminated.
For view frustum culling, there is a simple technique for exploiting
frame-to-frame coherency.
4
If a BV is found to be outside a certain plane
of the frustum in one frame, then (assuming that the viewer does not move
too quickly) it will probably be outside that plane in the next frame too.
So if a BV was outside a certain plane, then an index to this plane is stored
4
This is also called temporal coherency.