Enum TexFormat

Source
#[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§

Source§

impl Clone for TexFormat

Source§

fn clone(&self) -> TexFormat

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TexFormat

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TexFormat

Source§

fn eq(&self, other: &TexFormat) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TexFormat

Source§

impl Eq for TexFormat

Source§

impl StructuralPartialEq for TexFormat

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more