pub struct ReinsertionOptimizer { /* private fields */ }Expand description
Restructures the BVH, optimizing node locations within the BVH hierarchy per SAH cost.
Implementations§
Source§impl ReinsertionOptimizer
impl ReinsertionOptimizer
Sourcepub fn run(
&mut self,
bvh: &mut Bvh2,
batch_size_ratio: f32,
ratio_sequence: Option<Vec<f32>>,
)
pub fn run( &mut self, bvh: &mut Bvh2, batch_size_ratio: f32, ratio_sequence: Option<Vec<f32>>, )
Restructures the BVH, optimizing node locations within the BVH hierarchy per SAH cost. batch_size_ratio: Fraction of the number of nodes to optimize per iteration. ratio_sequence: A sequence of ratios to preform reinsertion at. These are as a proportion of the batch_size_ratio. If None, the following sequence is used: (1..32).step_by(2).map(|n| 1.0 / n as f32) or 1/1, 1/3, 1/5, 1/7, 1/9, 1/11, 1/13, 1/15, 1/17, 1/19, 1/21, 1/23, 1/25, 1/27, 1/29, 1/31
Sourcepub fn run_with_candidates(
&mut self,
bvh: &mut Bvh2,
candidates: &[u32],
iterations: u32,
)
pub fn run_with_candidates( &mut self, bvh: &mut Bvh2, candidates: &[u32], iterations: u32, )
Restructures the BVH, optimizing given node locations within the BVH hierarchy per SAH cost.
§Arguments
candidates- A list of ids for nodes that need to be re-inserted.iterations- The number of times reinsertion is run. Parallel reinsertion passes can result in conflicts that potentially limit the proportion of reinsertions in a single pass.
pub fn optimize_impl( &mut self, bvh: &mut Bvh2, ratio_sequence: Option<Vec<f32>>, )
pub fn optimize_specific_candidates(&mut self, bvh: &mut Bvh2, iterations: u32)
Trait Implementations§
Source§impl Default for ReinsertionOptimizer
impl Default for ReinsertionOptimizer
Source§fn default() -> ReinsertionOptimizer
fn default() -> ReinsertionOptimizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ReinsertionOptimizer
impl RefUnwindSafe for ReinsertionOptimizer
impl Send for ReinsertionOptimizer
impl Sync for ReinsertionOptimizer
impl Unpin for ReinsertionOptimizer
impl UnwindSafe for ReinsertionOptimizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more