pub struct SkyModel {
pub params: AtmosphereParams,
}Expand description
Physical sky colour model using single-scattering path integrals.
Fields§
§params: AtmosphereParamsImplementations§
Source§impl SkyModel
impl SkyModel
pub fn new(params: AtmosphereParams) -> Self
Sourcepub fn sky_color(&self, ray_dir: Vec3, n_steps: usize) -> Vec3
pub fn sky_color(&self, ray_dir: Vec3, n_steps: usize) -> Vec3
Compute sky colour for a view ray ray_dir (unit vector).
Uses n_steps integration steps along the view ray, and n_light_steps
for each secondary ray toward the sun.
Sourcepub fn sun_transmittance(&self, ray_dir: Vec3) -> Vec3
pub fn sun_transmittance(&self, ray_dir: Vec3) -> Vec3
Compute transmittance along a ray from origin toward the sun.
Sourcepub fn sky_irradiance(&self, normal: Vec3) -> Vec3
pub fn sky_irradiance(&self, normal: Vec3) -> Vec3
Approximate sky irradiance on a surface with the given normal.
Integrates the sky radiance over the upper hemisphere and weights by NdotL. Uses a coarse stratified sample.
Auto Trait Implementations§
impl Freeze for SkyModel
impl RefUnwindSafe for SkyModel
impl Send for SkyModel
impl Sync for SkyModel
impl Unpin for SkyModel
impl UnsafeUnpin for SkyModel
impl UnwindSafe for SkyModel
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.