Skip to main content

sah_best_split

Function sah_best_split 

Source
pub fn sah_best_split(
    aabbs: &[AabbGpu],
    indices: &[usize],
    axis: usize,
    num_bins: usize,
) -> Option<usize>
Expand description

Surface Area Heuristic (SAH) split for BVH construction.

Evaluates num_bins candidate split planes along the given axis and returns the bin index (from 0 to num_bins-1) that minimises the SAH cost.

Returns None if all primitives have the same centroid along the axis.