Single-threaded top-down builder that partitions primitives based on a binned approximation of the Surface Area Heuristic (SAH).
This builder is inspired by "On Fast Construction of SAH-based Bounding Volume Hierarchies", by I. Wald.
Definition at line 19 of file binned_sah_builder.h.
Classes | |
struct | Bin |
struct | Split |
Static Public Member Functions | |
static BVH_ALWAYS_INLINE Bvh< Node > | build (std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config={}) |
Protected Types | |
using | Bins = std::array<Bin, BinCount> |
using | PerAxisBins = std::array<Bins, Node::dimension> |
![]() | |
using | BBox = bvh::v2::BBox<Scalar, Node::dimension> |
using | Scalar = typename Node::Scalar |
using | Vec = bvh::v2::Vec<Scalar, Node::dimension> |
Protected Member Functions | |
BVH_ALWAYS_INLINE | BinnedSahBuilder (std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config) |
size_t | fallback_split (size_t axis, size_t begin, size_t end) |
BVH_ALWAYS_INLINE void | fill_bins (PerAxisBins &per_axis_bins, const BBox &bbox, size_t begin, size_t end) |
void | find_best_split (size_t axis, const Bins &bins, Split &best_split) |
std::vector< size_t > & | get_prim_ids () override |
std::optional< size_t > | try_split (const BBox &bbox, size_t begin, size_t end) override |
![]() | |
BVH_ALWAYS_INLINE | TopDownSahBuilder (std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config) |
Bvh< Node > | build () |
BVH_ALWAYS_INLINE BBox | compute_bbox (size_t begin, size_t end) const |
BVH_ALWAYS_INLINE const std::vector< size_t > & | get_prim_ids () const |
Protected Attributes | |
std::vector< size_t > | prim_ids_ |
![]() | |
std::span< const BBox > | bboxes_ |
std::span< const Vec > | centers_ |
const Config & | config_ |
#include <bvh/v2/binned_sah_builder.h>
Definition at line 65 of file binned_sah_builder.h.
|
protected |
Definition at line 66 of file binned_sah_builder.h.
|
inlineprotected |
Definition at line 70 of file binned_sah_builder.h.
|
inlinestatic |
Definition at line 32 of file binned_sah_builder.h.
|
inlineprotected |
Definition at line 118 of file binned_sah_builder.h.
|
inlineprotected |
Definition at line 82 of file binned_sah_builder.h.
|
inlineprotected |
Definition at line 101 of file binned_sah_builder.h.
|
inlineoverrideprotectedvirtual |
Implements bvh::v2::TopDownSahBuilder< Node >.
Definition at line 80 of file binned_sah_builder.h.
|
inlineoverrideprotectedvirtual |
Implements bvh::v2::TopDownSahBuilder< Node >.
Definition at line 128 of file binned_sah_builder.h.
|
protected |
Definition at line 68 of file binned_sah_builder.h.