Hello to everyone in the game development and graphics rendering community! I've encountered a specific issue, a 'BVH black hole', within a SAH-constructed BVH tree. This phenomenon refers to a very specific, small spot where an excessive number of BVH Nodes or triangles within these nodes accumulate, causing a significant drop in frame rate during applications such as ray casting. Has anyone else experienced a similar situation or have any potential solutions or advice? All input is greatly appreciated. Let's get a discussion started! #BVH #3DRendering #PhysicsEngine #GameDev #PerformanceIssues #RayCasting
@bero SAH trees are usually not balanced. I recommend to compute the total surface area of the tree (add up all internal node areas). Then compare with the result from a simple heuristic like median split. The SAH build should have lower total surface area.
Also make sure you don't have many triangles overlapped in one spot. SAH can't fix degenerate data.

@erin_catto

I have now implemented another additional BVH construction mode in the last few hours, which is based on my 3D Dynamic AABB Tree implementation in my physics engine KRAFT, which, in turn, is based on your Box2D BVH concepts but with tree data structure optimizations such as stack-free traversal in a linear skip-list style and merging of leaf nodes to ensure a minimum triangle count as post-processing steps. Unfortunately, it didn't help much, but at least there was a slight improvement. Later, I'll try the 'Mean/Largest-Axis-Variance' splitting approach, and if that doesn't help either, I guess I'll have to implement some mesh cleanup preprocessing and vertex count decimation to keep the number of collision mesh triangles at a moderate scale.