Even though testing individual dynamic objects with Umbra::OcclusionBuffer::isAABBVisible() is extremely fast, sometimes the overhead when accessing the objects in memory and setting their visibility state is considerable. In such cases a hierarchical data structure such as an octree for handling the dynamic objects comes in handy. If the dynamic objects in a scene are stored in an octree, one can hide a large number of objects with just a single test and thus avoid accessing their data in memory altogether.
Just using Umbra::OcclusionBuffer::isAABBVisible() is enough for hiding entire occluded octree nodes, but it can be very useful to handle the exact opposite: when an octree node is entirely visible. In this case testing the child nodes of the visible octree node can be skipped and all objects in the visible node can be tagged as visible. To do this Umbra::OcclusionBuffer::testAABBVisibility() has to be used. As with the isAABBVisibile() test, the function takes the bound minimum and maximum coordinates as parameters. Also, Umbra::OcclusionBuffer::TEST_FULL_VISIBILITY has to be given as the third parameter. The following are the possible return values:
- OCCLUDED - AABB is hidden entirely
- VISIBLE - AABB is partially visible
- FULLY_VISIBLE - AABB is fully visible
Without the last parameter the test is slightly faster to perform, but FULLY_VISIBLE is omitted from the list of possible return values.
Similar test is supported for screen space rectangles, see Umbra::OcclusionBuffer::testAARectVisibility().