Hierarchical Bounding Volume October 11, 2005 () Hierarchical - - PowerPoint PPT Presentation

hierarchical bounding volume
SMART_READER_LITE
LIVE PREVIEW

Hierarchical Bounding Volume October 11, 2005 () Hierarchical - - PowerPoint PPT Presentation

Hierarchical Bounding Volume October 11, 2005 () Hierarchical Bounding Volume October 11, 2005 1 / 15 Outline Introduction to hierarchical bounding volume (HBV) Tree generation Other optimization issues () Hierarchical Bounding Volume


slide-1
SLIDE 1

Hierarchical Bounding Volume

October 11, 2005

() Hierarchical Bounding Volume October 11, 2005 1 / 15

slide-2
SLIDE 2

Outline

Introduction to hierarchical bounding volume (HBV) Tree generation Other optimization issues

() Hierarchical Bounding Volume October 11, 2005 2 / 15

slide-3
SLIDE 3

Introduction to HBV

A HBV is a tree structure formed by bounding volumes. In intersection testing, child nodes are tested only if their parents intersect with the ray.

() Hierarchical Bounding Volume October 11, 2005 3 / 15

slide-4
SLIDE 4

More than one way to build the tree...

() Hierarchical Bounding Volume October 11, 2005 4 / 15

slide-5
SLIDE 5

What is a “good tree”? (1/2)

We build the tree in order to reduce intersection tests. Thus, the quality of a tree can be represented by E[X], where X denotes the number of intersection tests for each ray.

() Hierarchical Bounding Volume October 11, 2005 5 / 15

slide-6
SLIDE 6

What is a “good tree”? (2/2)

E[X] can be expressed by: E[X] =

  • n

anP(ray hits n | ray hits the root) where n denotes nodes in the tree, and an denotes the additional intersection tests when the ray hits n. Actually, an is the number of child of n.

() Hierarchical Bounding Volume October 11, 2005 6 / 15

slide-7
SLIDE 7

Approximation of the Conditional Probability

Assuming uniform distribution for ray directions, the probability that the ray hits a bounding box is proportional to the solid angle spanned by it. At large distances, this is approximately proportional to the surface area of the bounding box. Therefore, the conditional probability can be expressed by: P(ray hits n | ray hits the root) = surface area of n surface area of the root

() Hierarchical Bounding Volume October 11, 2005 7 / 15

slide-8
SLIDE 8

Tree Generation

Finding the optimal tree may take too much computation. However, finding an suboptimal one is acceptable. Construct the suboptimal tree by heuristic search:

1

Initialize the tree as empty.

2

For each primitive, find a insertion point for it that the increased cost (E[X]) is minimalized.

3

Repeat until all primitives are inserted.

() Hierarchical Bounding Volume October 11, 2005 8 / 15

slide-9
SLIDE 9

Finding the Best Insertion Point

We don’t need to search the whole tree. For each internal node, we can prune its children which have higher insertion cost than others. Therefore, we only search nodes along a path from root to some leaf node. The time complexity is approximately O(n log n)

() Hierarchical Bounding Volume October 11, 2005 9 / 15

slide-10
SLIDE 10

Example

30 47 25 34 41 56

() Hierarchical Bounding Volume October 11, 2005 10 / 15

slide-11
SLIDE 11

Other Optimization Issues

Tree traversal optimization Intersection ray V.S. shadow ray Object cache

() Hierarchical Bounding Volume October 11, 2005 11 / 15

slide-12
SLIDE 12

Tree Traversal Optimization

In HBV algorithm, the tree is searched in a fixed order (usually DFS).

A C B D E F

() Hierarchical Bounding Volume October 11, 2005 12 / 15

slide-13
SLIDE 13

Tree Traversal Optimization

In HBV algorithm, the tree is searched in a fixed order (usually DFS).

A C B D E F

We can pack the tree into an array with skip pointers, which reduce traversal time.

A C B D E F

nil

() Hierarchical Bounding Volume October 11, 2005 12 / 15

slide-14
SLIDE 14

Intersection Ray V.S Shadow Ray

We don’t care about the intersection point of shadow rays. Different acceleration structures can be used for intersection rays and shadow rays separately. In general, grids are faster for intersection rays, and HBV are faster for shadow rays.

() Hierarchical Bounding Volume October 11, 2005 13 / 15

slide-15
SLIDE 15

Object Cache

Rays often have spatial coherency, and we can cache the object hit by the previous ray. For intersection rays, the ray will still need to be check against the environment.

Mailboxes are used to prevent duplicated checks.

For shadow rays, we need to cache different objects for each light source. Reflected and transmitted rays are ignored in this scheme, because they are usually spatially different.

() Hierarchical Bounding Volume October 11, 2005 14 / 15

slide-16
SLIDE 16

Thank you!

() Hierarchical Bounding Volume October 11, 2005 15 / 15