[][src]Struct web_glitz::sampler::ShadowSampler

pub struct ShadowSampler { /* fields omitted */ }

Samples depth values and compares them to a reference value using a CompareFunction.

A shadow sampler can only be used with a texture that uses a depth format or a depth stencil stencil format. Rather than obtaining a (filtered) texel sample for certain texture coordinates like a normal Sampler, sampling with a ShadowSampler compares the depth texel values closest to the sampled coordinates to a reference value using a CompareFunction. The value returned is a floating point value in the range 0.0..=1.0 where the value signifies the proportion of the texels that passed the CompareFunction, for example: if no values passed, it returns 0.0; if all values passed it returns 1.0; if 1 out of 4 samples passed it returns 0.25.

See the documentation for each of the CompareFunction variants for descriptions of how each respective function decides whether or not a texel value passes.

See the documentation for RenderingContext::create_shadow_sampler for details on how to create a ShadowSampler.

Methods

impl ShadowSampler[src]

pub fn compare(&self) -> CompareFunction[src]

The CompareFunction used by thisShadowSampler.

See type documentation for ShadowSampler and the documentation for CompareFunction for details.

pub fn wrap_s(&self) -> Wrap[src]

The wrapping method that this ShadowSampler uses when sampling a value at coordinates outside the range 0.0..=1.0 in the S ("width") direction in texture space.

See Wrap for details.

pub fn wrap_t(&self) -> Wrap[src]

The wrapping method that this ShadowSampler uses when sampling a value at coordinates outside the range 0.0..=1.0 in the T ("height") direction in texture space.

See Wrap for details.

pub fn wrap_r(&self) -> Wrap[src]

The wrapping method that this ShadowSampler uses when sampling a value at coordinates outside the range 0.0..=1.0 in the R ("depth") direction in texture space.

See Wrap for details.

Auto Trait Implementations

Blanket Implementations

impl<D, T> IntoBuffer<T> for D where
    D: Borrow<T> + 'static,
    T: Copy + 'static, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]