Single-threaded top-down builder that partitions primitives based on the Surface Area Heuristic (SAH).
Primitives are only sorted once along each axis.
Definition at line 18 of file sweep_sah_builder.h.
Classes | |
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 Member Functions | |
BVH_ALWAYS_INLINE | SweepSahBuilder (std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config) |
void | find_best_split (size_t axis, size_t begin, size_t end, Split &best_split) |
std::vector< size_t > & | get_prim_ids () override |
BVH_ALWAYS_INLINE void | mark_primitives (size_t axis, size_t begin, size_t split_pos, size_t end) |
std::optional< size_t > | try_split (const BBox &bbox, size_t begin, size_t end) override |
Protected Member Functions inherited from bvh::v2::TopDownSahBuilder< Node > | |
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< Scalar > | accum_ |
std::vector< bool > | marks_ |
std::vector< size_t > | prim_ids_ [Node::dimension] |
Protected Attributes inherited from bvh::v2::TopDownSahBuilder< Node > | |
std::span< const BBox > | bboxes_ |
std::span< const Vec > | centers_ |
const Config & | config_ |
Additional Inherited Members | |
Protected Types inherited from bvh::v2::TopDownSahBuilder< Node > | |
using | BBox = bvh::v2::BBox< Scalar, Node::dimension > |
using | Scalar = typename Node::Scalar |
using | Vec = bvh::v2::Vec< Scalar, Node::dimension > |
#include <bvh/v2/sweep_sah_builder.h>
|
inlineprotected |
Definition at line 49 of file sweep_sah_builder.h.
|
inlinestatic |
Definition at line 30 of file sweep_sah_builder.h.
|
inlineprotected |
Definition at line 68 of file sweep_sah_builder.h.
|
inlineoverrideprotectedvirtual |
Implements bvh::v2::TopDownSahBuilder< Node >.
Definition at line 66 of file sweep_sah_builder.h.
|
inlineprotected |
Definition at line 103 of file sweep_sah_builder.h.
|
inlineoverrideprotectedvirtual |
Implements bvh::v2::TopDownSahBuilder< Node >.
Definition at line 108 of file sweep_sah_builder.h.
|
protected |
Definition at line 46 of file sweep_sah_builder.h.
|
protected |
Definition at line 45 of file sweep_sah_builder.h.
|
protected |
Definition at line 47 of file sweep_sah_builder.h.