ReinsertionOptimizer

Struct ReinsertionOptimizer 

Source
pub struct ReinsertionOptimizer { /* private fields */ }
Expand description

Restructures the BVH, optimizing node locations within the BVH hierarchy per SAH cost.

Implementations§

Source§

impl ReinsertionOptimizer

Source

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

Source

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.
Source

pub fn optimize_impl( &mut self, bvh: &mut Bvh2, ratio_sequence: Option<Vec<f32>>, )

Source

pub fn optimize_specific_candidates(&mut self, bvh: &mut Bvh2, iterations: u32)

Trait Implementations§

Source§

impl Default for ReinsertionOptimizer

Source§

fn default() -> ReinsertionOptimizer

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.