#[repr(u32)]pub enum DepthTest {
Less = 0,
LessOrEq = 1,
Greater = 2,
GreaterOrEq = 3,
Equal = 4,
NotEqual = 5,
Always = 6,
Never = 7,
}
Expand description
Depth test describes how this material looks at and responds to depth information in the zbuffer! The default is Less, which means if the material pixel’s depth is Less than the existing depth data, (basically, is this in front of some other object) it will draw that pixel. Similarly, Greater would only draw the material if it’s ‘behind’ the depth buffer. Always would just draw all the time, and not read from the depth buffer at all. https://stereokit.net/Pages/StereoKit/DepthTest.html
Variants§
Less = 0
Default behavior, pixels behind the depth buffer will be discarded, and pixels in front of it will be drawn.
LessOrEq = 1
Pixels behind the depth buffer will be discarded, and pixels in front of, or at the depth buffer’s value it will be drawn. This could be great for things that might be sitting exactly on a floor or wall.
Greater = 2
Pixels in front of the zbuffer will be discarded! This is opposite of how things normally work. Great for drawing indicators that something is occluded by a wall or other geometry.
GreaterOrEq = 3
Pixels in front of (or exactly at) the zbuffer will be discarded! This is opposite of how things normally work. Great for drawing indicators that something is occluded by a wall or other geometry.
Equal = 4
Only draw pixels if they’re at exactly the same depth as the zbuffer!
NotEqual = 5
Draw any pixel that’s not exactly at the value in the zbuffer.
Always = 6
Don’t look at the zbuffer at all, just draw everything, always, all the time! At this point, the order at which the mesh gets drawn will be super important, so don’t forget about Material.QueueOffset!
Never = 7
Never draw a pixel, regardless of what’s in the zbuffer. I can think of better ways to do this, but uhh, this is here for completeness! Maybe you can find a use for it.
Trait Implementations§
impl Copy for DepthTest
impl Eq for DepthTest
impl StructuralPartialEq for DepthTest
Auto Trait Implementations§
impl Freeze for DepthTest
impl RefUnwindSafe for DepthTest
impl Send for DepthTest
impl Sync for DepthTest
impl Unpin for DepthTest
impl UnwindSafe for DepthTest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.