Modern movies and games render scenes filled with millions of triangles. A single frame may fire hundreds of millions of rays — thin probes that ask "what is the first object this direction hits?" If every ray had to test every triangle, the cost would be per ray, and with millions of rays and millions of triangles the arithmetic is hopeless.
The fix is elegant: wrap groups of objects in bounding boxes, then wrap those boxes in bigger boxes, building a tree. Before a ray wastes time on the triangles inside a box, it first tests the box itself. Miss the box? Skip everything inside. Hit the box? Descend one level and repeat with the children.
That single insight — reject whole branches with a cheap box test — drops the average cost per ray from to , a difference that separates a render that finishes in milliseconds from one that never finishes at all.
The most common flavour wraps each group in an axis-aligned bounding box (AABB): a rectangle whose sides run parallel to the coordinate axes. AABB tests reduce to six comparisons and are among the cheapest operations a CPU (or GPU) can do.
Comments
Loading comments...