pub struct BvhBuildParams {
pub pre_split: bool,
pub ploc_search_distance: PlocSearchDistance,
pub search_depth_threshold: usize,
pub reinsertion_batch_ratio: f32,
pub post_collapse_reinsertion_batch_ratio_multiplier: f32,
pub sort_precision: SortPrecision,
pub max_prims_per_leaf: u32,
pub collapse_traversal_cost: f32,
}Expand description
General build parameters for Bvh2 & CwBvh
Fields§
§pre_split: boolSplit large tris into multiple AABBs
ploc_search_distance: PlocSearchDistanceIn ploc, the number of nodes before and after the current one that are evaluated for pairing. 1 has a fast path in building and still results in decent quality BVHs esp. when paired with a bit of reinsertion.
search_depth_threshold: usizeBelow this depth a search distance of 1 will be used for ploc.
reinsertion_batch_ratio: f32Typically 0..1: ratio of nodes considered as candidates for reinsertion. Above 1 to evaluate the whole set multiple times. A little goes a long way. Try 0.01 or even 0.001 before disabling for build performance.
post_collapse_reinsertion_batch_ratio_multiplier: f32For Bvh2 only, a second pass of reinsertion after collapse. Since collapse reduces the node count, this reinsertion pass will be faster. 0 to disable. Relative to the initial reinsertion_batch_ratio.
sort_precision: SortPrecisionBits used for ploc radix sort.
max_prims_per_leaf: u32Min 1 (CwBvh will clamp to max 3, Bvh2 will clamp to max 255)
collapse_traversal_cost: f32Multiplier for traversal cost calculation during Bvh2 collapse (Does not affect CwBvh). A higher value will result in more primitives per leaf.
Implementations§
Source§impl BvhBuildParams
impl BvhBuildParams
pub const fn fastest_build() -> Self
pub const fn very_fast_build() -> Self
pub const fn fast_build() -> Self
Sourcepub const fn medium_build() -> Self
pub const fn medium_build() -> Self
Tries to be around the same build time as embree but with faster traversal
pub const fn slow_build() -> Self
pub const fn very_slow_build() -> Self
Trait Implementations§
Source§impl Clone for BvhBuildParams
impl Clone for BvhBuildParams
Source§fn clone(&self) -> BvhBuildParams
fn clone(&self) -> BvhBuildParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more