[−][src]Struct web_glitz::sampler::ShadowSampler
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
impl !Send for ShadowSampler
impl Unpin for ShadowSampler
impl !Sync for ShadowSampler
impl !UnwindSafe for ShadowSampler
impl !RefUnwindSafe for ShadowSampler
Blanket Implementations
impl<D, T> IntoBuffer<T> for D where
D: Borrow<T> + 'static,
T: Copy + 'static,
[src]
D: Borrow<T> + 'static,
T: Copy + 'static,
fn into_buffer<Rc>(Self, &Rc, UsageHint) -> Buffer<T> where
Rc: RenderingContext + Clone + 'static,
[src]
Rc: RenderingContext + Clone + 'static,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,