BuildBVH
Benchmarks EBGeometry’s BVH construction strategies. It builds a BVH over a random point cloud with
each available strategy – top-down (centroid, SAH, and midpoint partitioners), bottom-up along the
Morton, Nested, and Hilbert space-filling curves, and ClusterSAH – and reports the build time for
each (see Construction). For most strategies it times two ways of reaching a
queryable PackedBVH: the traditional TreeBVH-then-pack() path, and PackedBVH’s direct
constructor, which packs the primitives straight into the flat, queryable layout without building a
TreeBVH first (see Direct construction (no TreeBVH)). It times build only, not query performance or
tree quality.
The source for this example is at Examples/BuildBVH/main.cpp. See Building
for how to compile it with CMake, GNU Make, or a direct compiler invocation.
cd Examples/BuildBVH
./BuildBVH.ex