The current BVH implementation splits the objects array in half untill the size of each is 1. That means we get 1 node per object.
To optimize the BVH, we need to implement a SAH splitting logic. To reduce its time complexity from O(n2) to O(n), we need to implement a caching strategy and us a prefix/suffix sum approach in building each node.
The current BVH implementation splits the objects array in half untill the size of each is 1. That means we get 1 node per object.
To optimize the BVH, we need to implement a SAH splitting logic. To reduce its time complexity from O(n2) to O(n), we need to implement a caching strategy and us a prefix/suffix sum approach in building each node.