02562 - Rendering - Worksheet 6, Part 1

Initialization: 0

JS: 0

GPU: 0

Initialization: 0

JS: 0

GPU: 0

Initialization: 0

JS: 0

GPU: 0

How do BSP trees work? The axis-aligned BSP trees used here optimizes the number of ray-triangle intersection tests. It does this by recursively splitting the triangles into two groups based on the cost heurestic. The heurestic attempts to find a balance between optimizing the number of triangles on either side at split, but also the surface area of the triangles in order to make further splits efficient as well. The splits are chosen by going through each axis and calculating the cost heurestic when splitting in different places along that axis. The axis and place with the lowest cost heurestic is chosen. We continue splitting each side until a maximum number of splits is reached.

With the tree calculated, we can optimize rendering by going through the tree and recursively check which sides of the tree the ray can intersect, if any. When the max depth is reached, we can do ray-triangle intersection tests on a quite small number of triangles.