Split clipping back

(L) [2007/09/15] [Phantom] [Split clipping] Wayback!

I really liked the talk about 'early split clipping' at the RT07 conference, so I decided to implement it. The paper does not appear to be available online (title: Early Split Clipping for Bounding Volume Hierarchies), so let me summarize the idea:


A kD-tree outperforms a BVH because it is able to split triangles. Splitting triangles upfront is bad in all kinds of ways: It will hurt shading coherency, the number of nodes, predictability of memory usage and so on. The paper suggests to split bounding boxes rather than the primitives themselves. In other words: Change the BVH builder so that it builds a tree from triangle aabb's instead of the triangles themselves. Then, for large aabb's, split the aabb, and refit them to the original triangle (both aabb's will now refer to the same tri). The two (or more) boxes will fit the shape of the primitive better. The main advantage is that the BVH builder can benefit from the new split candidate positions high in the tree, thereby reducing overlap and overall node surface.


So, my first try: Find large triangles, and if found, split them in four by splitting all three edges. Emit four new bounding boxes for the new triangles. Result: Performance LOSS. The diagrams in the paper indicate this subdivision approach, but it is not a good idea, and the text actually proposes something else (split the bbox along the axis with the greatest extend).


Second try: Find largest extend, split if larger than 25. Or 35. Or whatever. Do not recurse, first make sure a single split helps. Result: Performance loss. At this point, I added some statistics to see what is going on. Results: Average tree depth decreases by 1 (for Sponza) from 24 to 23. Overall node surface area increases by 10%. But what is worse: Surface area of the 10 top levels of the tree also increases, albeit slightly. I expected this to go down.


Third try: Fully recursive split model. Any bbox above a certain size is split and split again until it is not 'too large'. This time, the top 10 levels of the BVH are reduced in surface (by 10%). Performance goes up with the same ratio.


So I got some gains, but it's nowhere near the 300% the authors claim. I didn't expect that by the way, since the authors where comparing single-ray BVH to single-ray kD, but perhaps a little bit more gains would have been nice. O well, I guess 10% is not bad for 4 hours of work. [SMILEY Smile]
_________________
--------------------------------------------------------------

Whatever
(L) [2007/09/18] [Fulgore] [Split clipping] Wayback!

I have actually been doing this exact thing for a long time (both for BVHs and BIHs). In my experience, it helps the most when you have long, thin diagonal triangles, i.e., when the ratio between the area/volume of the AABB vs the area of the triangle is very high. For nicely shaped axis-aligned triangles I haven't seen much performance benefit.

back