up to Schedule & Notes

Octtrees

Definition

An octtree is a hierarchical subdivision of space in which:

The hierarchical structure is shown below. Leaf nodes usually contain fewer than some fixed number of primitives.

Note that a primitive is usually stored in many leaf nodes.

Ray Tracing with Octtrees

A ray traverses an octtree depth first and stops at the first primitive intersection that it detects.

We start with the root AABB:

In the example below, the outer AABB is an internal node with four children. Three of the children are intersected by the ray. The child labelled 3 is pushed, then the child 2 is pushed, then the child 1 is pushed.

When child 1 is processed, it causes 1.2, then 1.1 to be pushed. When child 2 is processed, is causes 2.1 to be pushed. When child 3 is processed, it causes 3.3, then 3.2, then 3.1 to be pushed.

up to Schedule & Notes