pub struct PathState {
pub ray: Ray,
pub throughput: [f64; 3],
pub radiance: [f64; 3],
pub depth: u32,
pub max_depth: u32,
}Expand description
Path tracer state for a single sample path.
Fields§
§ray: RayCurrent ray.
throughput: [f64; 3]Accumulated throughput (product of BRDFs).
radiance: [f64; 3]Accumulated radiance.
depth: u32Current bounce depth.
max_depth: u32Maximum bounce depth.
Implementations§
Source§impl PathState
impl PathState
Sourcepub fn should_continue(&self) -> bool
pub fn should_continue(&self) -> bool
Returns true if path tracing should continue.
Sourcepub fn russian_roulette(&mut self, survival_prob: f64) -> bool
pub fn russian_roulette(&mut self, survival_prob: f64) -> bool
Apply Russian roulette termination. Returns false if path is terminated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathState
impl RefUnwindSafe for PathState
impl Send for PathState
impl Sync for PathState
impl Unpin for PathState
impl UnsafeUnpin for PathState
impl UnwindSafe for PathState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more