#[repr(u32)]pub enum TexFormat {
Show 20 variants
None = 0,
RGBA32 = 1,
RGBA32Linear = 2,
BGRA32 = 3,
BGRA32Linear = 4,
RG11B10 = 5,
RGB10A2 = 6,
RGBA64U = 7,
RGBA64S = 8,
RGBA64F = 9,
RGBA128 = 10,
R8 = 11,
R16u = 12,
R16s = 13,
R16f = 14,
R32 = 15,
DepthStencil = 16,
Depth32 = 17,
Depth16 = 18,
R8G8 = 19,
}
Expand description
What type of color information will the texture contain? A good default here is Rgba32. https://stereokit.net/Pages/StereoKit/TexFormat.html
see also Tex
crate::system::Renderer
Variants§
None = 0
A default zero value for TexFormat! Uninitialized formats will get this value and **** **** up so you know to assign it properly :)
RGBA32 = 1
Red/Green/Blue/Transparency data channels, at 8 bits per-channel in sRGB color space. This is what you’ll want most of the time you’re dealing with color images! Matches well with the Color32 struct! If you’re storing normals, rough/metal, or anything else, use Rgba32Linear.
RGBA32Linear = 2
Red/Green/Blue/Transparency data channels, at 8 bits per-channel in linear color space. This is what you’ll want most of the time you’re dealing with color data! Matches well with the Color32 struct.
BGRA32 = 3
Blue/Green/Red/Transparency data channels, at 8 bits per-channel in sRGB color space. This is a common swapchain format on Windows.
BGRA32Linear = 4
Blue/Green/Red/Transparency data channels, at 8 bits per-channel in linear color space. This is a common swapchain format on Windows.
RG11B10 = 5
Red/Green/Blue data channels, with 11 bits for R and G, and 10 bits for blue. This is a great presentation format for high bit depth displays that still fits in 32 bits! This format has no alpha channel.
RGB10A2 = 6
Red/Green/Blue/Transparency data channels, with 10 bits for R, G, and B, and 2 for alpha. This is a great presentation format for high bit depth displays that still fits in 32 bits, and also includes at least a bit of transparency!
RGBA64U = 7
Red/Green/Blue/Transparency data channels, at 16 bits per-channel! This is not common, but you might encounter it with raw photos, or HDR images. The u postfix indicates that the raw color data is stored as an unsigned 16 bit integer, which is then normalized into the 0, 1 floating point range on the GPU.
RGBA64S = 8
Red/Green/Blue/Transparency data channels, at 16 bits per-channel! This is not common, but you might encounter it with raw photos, or HDR images. The s postfix indicates that the raw color data is stored as a signed 16 bit integer, which is then normalized into the -1, +1 floating point range on the GPU.
RGBA64F = 9
Red/Green/Blue/Transparency data channels, at 16 bits per-channel! This is not common, but you might encounter it with raw photos, or HDR images. The f postfix indicates that the raw color data is stored as 16 bit floats, which may be tricky to work with in most languages.
RGBA128 = 10
Red/Green/Blue/Transparency data channels at 32 bits per-channel! Basically 4 floats per color, which is bonkers expensive. Don’t use this unless you know -exactly- what you’re doing.
R8 = 11
A single channel of data, with 8 bits per-pixel! This can be great when you’re only using one channel, and want to reduce memory usage. Values in the shader are always 0.0-1.0.
R16u = 12
A single channel of data, with 16 bits per-pixel! This is a good format for height maps, since it stores a fair bit of information in it. Values in the shader are always 0.0-1.0. TODO: remove during major version update, prefer s, f, or u postfixed versions of this format, this item is the same as r16u. A single channel of data, with 16 bits per-pixel! This is a good format for height maps, since it stores a fair bit of information in it. The u postfix indicates that the raw color data is stored as an unsigned 16 bit integer, which is then normalized into the 0, 1 floating point range on the GPU.
R16s = 13
A single channel of data, with 16 bits per-pixel! This is a good format for height maps, since it stores a fair bit of information in it. The s postfix indicates that the raw color data is stored as a signed 16 bit integer, which is then normalized into the -1, +1 floating point range on the GPU.
R16f = 14
A single channel of data, with 16 bits per-pixel! This is a good format for height maps, since it stores a fair bit of information in it. The f postfix indicates that the raw color data is stored as 16 bit floats, which may be tricky to work with in most languages.
R32 = 15
A single channel of data, with 32 bits per-pixel! This basically treats each pixel as a generic float, so you can do all sorts of strange and interesting things with this.
DepthStencil = 16
A depth data format, 24 bits for depth data, and 8 bits to store stencil information! Stencil data can be used for things like clipping effects, deferred rendering, or shadow effects.
Depth32 = 17
32 bits of data per depth value! This is pretty detailed, and is excellent for experiences that have a very far view distance.
Depth16 = 18
16 bits of depth is not a lot, but it can be enough if your far clipping plane is pretty close. If you’re seeing lots of flickering where two objects overlap, you either need to bring your far clip in, or switch to 32/24 bit depth.
R8G8 = 19
A double channel of data that supports 8 bits for the red channel and 8 bits for the green channel.
Trait Implementations§
impl Copy for TexFormat
impl Eq for TexFormat
impl StructuralPartialEq for TexFormat
Auto Trait Implementations§
impl Freeze for TexFormat
impl RefUnwindSafe for TexFormat
impl Send for TexFormat
impl Sync for TexFormat
impl Unpin for TexFormat
impl UnwindSafe for TexFormat
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.