ArticleslgStudy

computer science

Bounding volume hierarchy

Bounding volume hierarchy is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Bounding volume hierarchy rather than just read about it. In short: A bounding volume hierarchy (BVH) is a tree structure on a set of geometric objects. All geometric objects, which form the leaf nodes of the tree, are wrapped in bounding volumes.

Bounding volume hierarchy — main illustration
Bounding volume hierarchy — illustration

Key takeaways

  • Bounding volume hierarchy belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Bounding volume hierarchy to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Bounding volume hierarchy from memory before moving on to harder problems.

Reference excerpt

A bounding volume hierarchy (BVH) is a tree structure on a set of geometric objects. All geometric objects, which form the leaf nodes of the tree, are wrapped in bounding volumes. These nodes are then grouped as small sets and enclosed within larger bounding volumes. These, in turn, are also grouped and enclosed within other larger bounding volumes in a recursive fashion, eventually resulting in a tree structure with a single bounding volume at the top of the tree. Bounding volume hierarchies are used to support several operations on sets of geometric objects efficiently, such as in collision detection and ray tracing. Although wrapping objects in bounding volumes and performing collision tests on them before testing the object geometry itself simplifies the tests and can result in significant performance improvements, the same number of pairwise tests between bounding volumes are still being performed. By arranging the bounding volumes into a bounding volume hierarchy, the time complexity (the number of tests performed) can be reduced to logarithmic in the number of objects. With such a hierarchy in place, during collision testing, child volumes do not have to be examined if their parent volumes are not intersected (for example, if the bounding volumes of two bumper cars do not intersect, the bounding volumes of the bumpers themselves need not be checked for collision).

BVH design issues The choice of bounding volume is determined by a trade-off between two objectives. On the one hand, bounding volumes with a very simple shape can be stored in only a few bytes, and intersection tests and distance computations are simple and fast. On the other hand, bounding volumes should fit the corresponding data objects very tightly. One of the most commonly used bounding volumes is an axis-aligned minimum bounding box. The axis-aligned minimum bounding box for a given set of data objects is easy to compute, requires only a few bytes to store, and robust intersection tests are easy to implement and extremely fast. There are several desired properties for a BVH to consider when designing one for a specific application:

The nodes contained in any given sub-tree should be near each other. The lower down the tree, the nearer the nodes should be to each other. Each node in the BVH should be of minimum volume. The sum of all bounding volumes should be minimal. Greater attention should be paid to nodes near the root of the BVH. Pruning a node near the root of the tree removes more objects from further consideration. The volume of overlap of sibling nodes should be minimal. The BVH should be balanced with respect to both its node structure and its content. Balancing allows as much of the BVH as possible to be pruned whenever a branch is not traversed into. In terms of the structure of BVH, it has to be decided what degree (the number of children) and height to use in the tree representing the BVH. A tree of a low degree will be of greater height. That increases root-to-leaf traversal time. On the other hand, less work has to be expended at each visited node to check its children for overlap. The opposite holds for a high-degree tree: although the tree will be of smaller height, more work is spent at each node. In practice, binary trees (degree = 2) are by far the most common. One of the main reasons is that binary trees are easier to build.

Construction There are three primary categories of tree construction methods: top-down, bottom-up, and insertion methods.

Top-down methods Top-down methods proceed by partitioning the input set into two (or more) subsets, bounding them in the chosen bounding volume, then continuing to partition (and bound) recursively until each subset consists of only a single object represented by a leaf node. Top-down methods are easy to implement, fast to construct and by far the most popular, but do not result in the best possible trees in general.

The most crucial part for this approach is to decide how to partition objects in a node's region among the node's children. This can be done with a splitting plane to split a node's bounding volume into partitions so that having to traverse many child nodes is minimized. Simply using the midpoint of volume centroids for splitting might be a sub-optimal choice, as illustrated in the figure, where a big overlap volume occurs. Hence, good splitting criteria such as the surface-area heuristic (SAH) are often used with equal-size buckets of splitting planes, so that only at these splitting points, re-calculation of SAH is required.

Bottom-up methods Bottom-up methods start with the input set as the leaves of the tree and then group two (or more) of them to form a new (internal) node, proceed in the same manner until everything has been grouped under a single node (the root of the tree). Bottom-up methods are more difficult to implement, but likely to produce better trees in general. One example for this is the use of a Z-order curve (also known as Morton-order), where clusters can be found by simply taking a linear pass through a Morton-ordered array of leaves. Given the independent clusters of leaf nodes, sub-trees can be constructed in parallel and then further combined to form higher nodes. This parallelization makes the BVH construction very fast and can also be implemented in a hybrid manner, where all sub-trees are combined followed by a top-down approach.

Online methods Both top-down and bottom-up methods are considered off-line methods as they both require all objects to be available before construction starts. Insertion methods build the tree by inserting one object at a time, starting from an empty tree. The insertion location should be chosen that causes the tree to grow as little as possible according to a cost metric. Insertion methods are considered on-line methods since they do not require all objects to be available before construction starts and thus allow updates to be performed at runtime.

Compact BVH for efficient traversal

… excerpt ends here. Continue reading the full article.

Illustrations

Bounding volume hierarchy: BVH splitting plane selection that possibly lead to big overlap region (upper diagram) compared to a better selection (lower diagram)
BVH splitting plane selection that possibly lead to big overlap region (upper diagram) compared to a better selection (lower diagram)
Bounding volume hierarchy: BVH construction with buckets of splitting planes for fast SAH criteria check
BVH construction with buckets of splitting planes for fast SAH criteria check
Bounding volume hierarchy: Visualization of a flattened BVH tree for efficient traversal  [3]
Visualization of a flattened BVH tree for efficient traversal [3]

Worked examples

Example 1 — a first encounter with Bounding volume hierarchy

Start with the simplest possible case. Write down what Bounding volume hierarchy claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Bounding volume hierarchy before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Bounding volume hierarchy ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Bounding volume hierarchy

In research
Bounding volume hierarchy appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Bounding volume hierarchy in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Bounding volume hierarchy is common in secondary-school and first-year university syllabi. It links to neighbouring topics 3D computer graphics, Geometric data structures, Hierarchy, so understanding it makes those chapters shorter.
In everyday life
Look for Bounding volume hierarchy outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Bounding volume hierarchy” →

How to study Bounding volume hierarchy in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Bounding volume hierarchy means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Bounding volume hierarchy out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Bounding volume hierarchy in simple terms?

A bounding volume hierarchy (BVH) is a tree structure on a set of geometric objects. All geometric objects, which form the leaf nodes of the tree, are wrapped in bounding volumes.

Why does Bounding volume hierarchy matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Bounding volume hierarchy?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Bounding volume hierarchy.

Tags

  • 3D computer graphics
  • Geometric data structures
  • Hierarchy

Keep exploring