Multi-threaded top-down builder that partitions primitives using a grid.
Multiple instances of a single-threaded builder are run in parallel on that partition, generating many small trees. Finally, a top-level tree is built on these smaller trees to form the final BVH. This builder is inspired by "Rapid Bounding Volume Hierarchy Generation using Mini Trees", by P. Ganestam et al.
Definition at line 24 of file mini_tree_builder.h.
Classes | |
struct | Bin |
struct | BuildTask |
struct | Config |
struct | LocalBins |
Static Public Member Functions | |
static BVH_ALWAYS_INLINE Bvh< Node > | build (ThreadPool &thread_pool, std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config={}) |
Starts building a BVH with the given primitive data. | |
Private Types | |
using | BBox = bvh::v2::BBox< Scalar, Node::dimension > |
using | Scalar = typename Node::Scalar |
using | Vec = bvh::v2::Vec< Scalar, Node::dimension > |
Private Member Functions | |
BVH_ALWAYS_INLINE | MiniTreeBuilder (ThreadPool &thread_pool, std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config) |
std::vector< Bvh< Node > > | build_mini_trees () |
Bvh< Node > | build_top_bvh (std::vector< Bvh< Node > > &mini_trees) |
std::vector< Bvh< Node > > | prune_mini_trees (std::vector< Bvh< Node > > &&mini_trees) |
Private Attributes | |
std::span< const BBox > | bboxes_ |
std::span< const Vec > | centers_ |
const Config & | config_ |
ParallelExecutor | executor_ |
Friends | |
struct | BuildTask |
#include <bvh/v2/mini_tree_builder.h>
|
private |
Definition at line 27 of file mini_tree_builder.h.
|
private |
Definition at line 25 of file mini_tree_builder.h.
|
private |
Definition at line 26 of file mini_tree_builder.h.
|
inlineprivate |
Definition at line 147 of file mini_tree_builder.h.
|
inlinestatic |
Starts building a BVH with the given primitive data.
The build algorithm is multi-threaded, and runs on the given thread pool.
Definition at line 47 of file mini_tree_builder.h.
|
inlineprivate |
Definition at line 160 of file mini_tree_builder.h.
|
inlineprivate |
Definition at line 249 of file mini_tree_builder.h.
|
inlineprivate |
Definition at line 207 of file mini_tree_builder.h.
Definition at line 61 of file mini_tree_builder.h.
|
private |
Definition at line 143 of file mini_tree_builder.h.
|
private |
Definition at line 144 of file mini_tree_builder.h.
|
private |
Definition at line 145 of file mini_tree_builder.h.
|
private |
Definition at line 142 of file mini_tree_builder.h.