pub struct Shader<'a> {
pub sun_pos: Point3<f64>,
pub light: [f64; 3],
pub shadow: [f64; 2],
pub spec_pow: i32,
pub occ_dist: [f64; 2],
pub fall_off: f64,
pub soft_shadow_samples: Option<(i32, f64)>,
pub ambient_shadow_samples: Option<(i32, i32)>,
pub sky_grad: &'a Gradient<LinSrgba>,
pub data_grad: &'a Gradient<LinSrgba>,
}
Expand description
Shader settings.
Fields
sun_pos: Point3<f64>
Sun position (m).
light: [f64; 3]
Ambient, diffuse, and occlusion lighting fractions.
shadow: [f64; 2]
Ambient, diffuse, and occlusion shadowing fractions.
spec_pow: i32
Ambient lighting fraction.
occ_dist: [f64; 2]
Lighting and shadowing occlusion testing distances.
fall_off: f64
Effect fall-off rate.
soft_shadow_samples: Option<(i32, f64)>
Optional number of soft shadowing samples, and angular radius (rad).
ambient_shadow_samples: Option<(i32, i32)>
Optional number of ambient shadowing samples and the scaling power.
sky_grad: &'a Gradient<LinSrgba>
Sky colour gradient.
data_grad: &'a Gradient<LinSrgba>
Data colouring gradient.
Implementations
sourceimpl<'a> Shader<'a>
impl<'a> Shader<'a>
sourcepub fn new(
sun_pos: Point3<f64>,
light: [f64; 3],
shadow: [f64; 2],
spec_pow: i32,
occ_dist: [f64; 2],
fall_off: f64,
soft_shadow_samples: Option<(i32, f64)>,
ambient_shadow_samples: Option<(i32, i32)>,
sky_grad: &'a Gradient<LinSrgba>,
data_grad: &'a Gradient<LinSrgba>
) -> Self
pub fn new(
sun_pos: Point3<f64>,
light: [f64; 3],
shadow: [f64; 2],
spec_pow: i32,
occ_dist: [f64; 2],
fall_off: f64,
soft_shadow_samples: Option<(i32, f64)>,
ambient_shadow_samples: Option<(i32, i32)>,
sky_grad: &'a Gradient<LinSrgba>,
data_grad: &'a Gradient<LinSrgba>
) -> Self
Construct a new instance.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Shader<'a>
impl<'a> Send for Shader<'a>
impl<'a> Sync for Shader<'a>
impl<'a> Unpin for Shader<'a>
impl<'a> UnwindSafe for Shader<'a>
Blanket Implementations
sourceimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
sourcefn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified method Read more
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford method by default Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, U> IntoColor<U> for T where
U: FromColor<T>,
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
sourceimpl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
sourcefn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
sourcefn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
sourcefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
sourcefn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
sourcefn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
sourcefn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more