Ray Tracing with Reduced-Precision Bounding Volume Hierarchies (discusses optimal number of primitives per leaf)
Heuristic for determining whether BVH has degraded too far
Measure ratio of parent node surface area to sum of two children.
Ratio is computed at the beginning on BVH generation and ratio is stored per node
After change the ratio differences can be summed, divided by the number of inner nodes (n - 1) and used to determine whether the tree should be rebuilt or not.
Paper suggests 40% difference is a good time
A similar approach should be able to work with the surface area score provided by getBVHExtremes to see how high the score has gotten relative to the original score.
Because all children are described after the parent in the node array the children can just be traversed in reverse order in the case that all bounds are being updated. (benefit isn't mind blowing even in the worst case where everything must update compared to the current recursive approach)
The "split" axis can be described as the one where the child nodes are furthest separated. Could it be possible that the partition axis is not the optimal "split" axis after the triangles have been split and bounds created?
When refitting it's possible that the best split axis will have changed and should be updated in the bounds data. The paper recommends using centroid distance to determine the best split.
When trying to build a BVH for an animated model you can create multiple BVHs with representative poses over the course of the animation and select the one that has lowest max score across all poses (assuming a good representative pose cannot be used).
Or SAH can account for multiple poses during testing.
Related to #132
Refitting references here.