#[non_exhaustive]
pub enum FogMode {
Linear,
Exponential,
ExponentialSquared,
}
Expand description
Determines the equation used to calculate the blend factor while fogging is enabled.
The simplest FogMode::Linear
mode
determines f as:
f = end - eye_distance / end - start
Where eye_distance is the distance of the current fragment in eye coordinates from the origin.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Linear
Calculates the fog blend factor as:
f = end - eye_distance / end - start
Exponential
Calculates the fog blend factor as:
f = e ^ -(density * eye_distance)
ExponentialSquared
Calculates the fog blend factor as:
f = e ^ -(density * eye_distance)^2
Trait Implementations
sourceimpl Ord for FogMode
impl Ord for FogMode
sourceimpl PartialOrd<FogMode> for FogMode
impl PartialOrd<FogMode> for FogMode
sourcefn partial_cmp(&self, other: &FogMode) -> Option<Ordering>
fn partial_cmp(&self, other: &FogMode) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for FogMode
impl Eq for FogMode
impl StructuralEq for FogMode
impl StructuralPartialEq for FogMode
Auto Trait Implementations
impl RefUnwindSafe for FogMode
impl Send for FogMode
impl Sync for FogMode
impl Unpin for FogMode
impl UnwindSafe for FogMode
Blanket Implementations
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
impl<T> Clamp<T> for T where
T: PartialOrd<T>,
impl<T> Clamp<T> for T where
T: PartialOrd<T>,
fn clamped(self, min: T, max: T) -> T
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.