BVH builder using SAH (Surface Area Heuristic) More...
#include <BVHBuilder.h>
Public Member Functions | |
| std::vector< BVHNode > | build (const RayTracingGeometry &geometry) |
| Build BVH from geometry. | |
| const std::vector< uint32_t > & | getPrimitiveIndices () const |
| Get primitive indices for leaves (ordered by tree structure) | |
| std::vector< CWBVH_Node > | convertToCWBVH (const std::vector< BVHNode > &bvh2_nodes) |
| Convert BVH2 to CWBVH (Compressed Wide BVH) | |
BVH builder using SAH (Surface Area Heuristic)
Constructs a high-quality BVH on CPU using:
Definition at line 140 of file BVHBuilder.h.
| std::vector< BVHNode > helios::BVHBuilder::build | ( | const RayTracingGeometry & | geometry | ) |
Build BVH from geometry.
| [in] | geometry | Geometry data (all primitive types) |
Steps:
Definition at line 24 of file BVHBuilder.cpp.
| std::vector< CWBVH_Node > helios::BVHBuilder::convertToCWBVH | ( | const std::vector< BVHNode > & | bvh2_nodes | ) |
Convert BVH2 to CWBVH (Compressed Wide BVH)
| bvh2_nodes | Flat BVH2 array from build() |
Conversion process:
Expected performance: 1.6-2.1x faster traversal for incoherent rays
Definition at line 470 of file BVHBuilder.cpp.
|
inline |
Get primitive indices for leaves (ordered by tree structure)
Used to reorder geometry data to match BVH leaf layout. Each leaf's primitives are contiguous in this array.
Definition at line 163 of file BVHBuilder.h.