[−][src]Struct web_glitz::pipeline::graphics::DepthRange
Defines how a fragment's depth output will be mapped onto the range 0.0..1.0
from the near
plane at 0.0
to the far plane at 1.0
.
- Values smaller than the lower bound will be mapped to
0.0
. - Values greater than the upper bound will be mapped to
1.0
. - Values contained on the range will be mapped to the range
0.0..1.0
.
Can be constructed from a RangeInclusive
use std::convert::TryFrom; use web_glitz::pipeline::graphics::DepthRange; let depth_range = DepthRange::try_from(0.2..=0.8).unwrap();
The lower bound of the range must not be smaller than 0.0, the upper bound of the range must not
be greater than 1.0
, and the lower bound must be strictly smaller than the upper bound;
otherwise, an [InvalidDepthRange] error is returned.
A default depth range may be obtained through Default:
use std::convert::TryFrom; use web_glitz::pipeline::graphics::DepthRange; assert_eq!(DepthRange::default(), DepthRange::try_from(0.0..=1.0).unwrap());
Implementations
impl DepthRange
[src]
pub fn near(&self) -> f32
[src]
The lower bound of this range that will be mapped onto the near plane at 0.0
.
pub fn far(&self) -> f32
[src]
The upper bound of this range that will be mapped onto the far plane at 1.0
.
Trait Implementations
impl Clone for DepthRange
[src]
fn clone(&self) -> DepthRange
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DepthRange
[src]
impl Default for DepthRange
[src]
impl PartialEq<DepthRange> for DepthRange
[src]
fn eq(&self, other: &DepthRange) -> bool
[src]
fn ne(&self, other: &DepthRange) -> bool
[src]
impl StructuralPartialEq for DepthRange
[src]
impl TryFrom<RangeInclusive<f32>> for DepthRange
[src]
Auto Trait Implementations
impl RefUnwindSafe for DepthRange
impl Send for DepthRange
impl Sync for DepthRange
impl Unpin for DepthRange
impl UnwindSafe for DepthRange
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<D, T> IntoBuffer<T> for D where
D: Borrow<T> + 'static,
T: Copy + 'static,
[src]
D: Borrow<T> + 'static,
T: Copy + 'static,
pub fn into_buffer<Rc>(Self, &Rc, BufferId, UsageHint) -> Buffer<T> where
Rc: RenderingContext + Clone + 'static,
[src]
Rc: RenderingContext + Clone + 'static,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
pub 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>,