#[repr(u32)]pub enum Transparency {
None = 1,
MSAA = 2,
Blend = 3,
Add = 4,
}
Expand description
Also known as ‘alpha’ for those in the know. But there’s actually more than one type of transparency in rendering! The horrors. We’re keepin’ it fairly simple for now, so you get three options! https://stereokit.net/Pages/StereoKit/Transparency.html
Variants§
None = 1
Not actually transparent! This is opaque! Solid! It’s the default option, and it’s the fastest option! Opaque objects write to the z-buffer, the occlude pixels behind them, and they can be used as input to important Mixed Reality features like Late Stage Reprojection that’ll make your view more stable!
MSAA = 2
Also known as Alpha To Coverage, this mode uses MSAA samples to create transparency. This works with a z-buffer and therefore functionally behaves more like an opaque material, but has a quantized number of “transparent values” it supports rather than a full range of 0-255 or 0-1. For 4x MSAA, this will give only 4 different transparent values, 8x MSAA only 8, etc. From a performance perspective, MSAA usually is only costly around triangle edges, but using this mode, MSAA is used for the whole triangle.
Blend = 3
This will blend with the pixels behind it. This is transparent! You may not want to write to the z-buffer, and it’s slower than opaque materials.
Add = 4
This will straight up add the pixel color to the color buffer! This usually looks -really- glowy, so it makes for good particles or lighting effects.
Trait Implementations§
Source§impl Clone for Transparency
impl Clone for Transparency
Source§fn clone(&self) -> Transparency
fn clone(&self) -> Transparency
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Transparency
impl Debug for Transparency
Source§impl PartialEq for Transparency
impl PartialEq for Transparency
impl Copy for Transparency
impl Eq for Transparency
impl StructuralPartialEq for Transparency
Auto Trait Implementations§
impl Freeze for Transparency
impl RefUnwindSafe for Transparency
impl Send for Transparency
impl Sync for Transparency
impl Unpin for Transparency
impl UnwindSafe for Transparency
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.