pub struct LightingUniforms { /* private fields */ }Expand description
Bundles of uniforms supplied to lighting and shading routines.
Implementations§
Source§impl LightingUniforms
Implements LightingUniforms builders and the LightingUniforms::shade
entry point used by the ray tracer.
impl LightingUniforms
Implements LightingUniforms builders and the LightingUniforms::shade
entry point used by the ray tracer.
Sourcepub fn with_eye(eye: Vector3D) -> LightingUniforms
pub fn with_eye(eye: Vector3D) -> LightingUniforms
Sourcepub fn shade(
&self,
position: Vector3D,
normal: Vector3D,
material: &Material,
occluders: &[(Vector3D, f64)],
) -> Vector3D
pub fn shade( &self, position: Vector3D, normal: Vector3D, material: &Material, occluders: &[(Vector3D, f64)], ) -> Vector3D
Shades a surface point by summing ambient, per-light Lambertian, and per-light Phong contributions, gated by a soft shadow factor.
§Arguments
Vector3D- The world-space position of the shaded point.Vector3D- The surface normal (unit length).&Material- The material at the shaded point.&[(Vector3D, f64)]-(center, radius)occluder tuples used bysoft_shadow_factor.
§Returns
Vector3D- The final shaded color.
Source§impl LightingUniforms
impl LightingUniforms
pub fn get_mut_lights(&mut self) -> &mut Vec<Light>
pub fn set_lights(&mut self, val: Vec<Light>) -> &mut Self
pub fn get_ambient(&self) -> Vector3D
pub fn get_mut_ambient(&mut self) -> &mut Vector3D
pub fn set_ambient(&mut self, val: Vector3D) -> &mut Self
pub fn get_eye(&self) -> Vector3D
pub fn get_mut_eye(&mut self) -> &mut Vector3D
pub fn set_eye(&mut self, val: Vector3D) -> &mut Self
Trait Implementations§
Source§impl Clone for LightingUniforms
impl Clone for LightingUniforms
Source§fn clone(&self) -> LightingUniforms
fn clone(&self) -> LightingUniforms
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LightingUniforms
impl Debug for LightingUniforms
Source§impl PartialEq for LightingUniforms
impl PartialEq for LightingUniforms
impl StructuralPartialEq for LightingUniforms
Auto Trait Implementations§
impl Freeze for LightingUniforms
impl RefUnwindSafe for LightingUniforms
impl Send for LightingUniforms
impl Sync for LightingUniforms
impl Unpin for LightingUniforms
impl UnsafeUnpin for LightingUniforms
impl UnwindSafe for LightingUniforms
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