pub enum ChannelEncoding {
CompressedPosition,
UncompressedPosition,
PlanarPosition,
CompressedUv,
UncompressedUv,
Color,
CompressedNormal,
Joints,
Weights,
}Expand description
How one compressed channel is encoded as a vertex attribute.
Variants§
CompressedPosition
An AABB-quantized position: Snorm16x4, decoded through
MeshMetadata’s bounding box.
UncompressedPosition
A full-precision position: Float32x3.
PlanarPosition
A full-precision planar position: Float32x2. The missing third
component reads as zero, which is what geometry that already lies in the
target’s plane — a user interface’s, say — would store anyway.
CompressedUv
A range-remapped UV: Snorm16x2, decoded through
MeshMetadata::uv_min_and_extents.
UncompressedUv
A full-precision UV: Float32x2.
Color
A vertex color, Unorm8x4, stored as it arrives.
CompressedNormal
A unit normal, octahedral-encoded into two snorm16 lanes.
A normal needs no decode parameters — the encoding is absolute, unlike
the per-mesh ranges positions and UVs are quantized against — so a
normal never makes its variant read the metadata array. The encoding is
also the only one a stream offers: octahedral Snorm16x2 resolves a
direction to well under a degree, which three full-precision lanes
would not improve on for shading.
Joints
A joint index, Uint16x4. Indices address data structurally rather
than interpolating, so they are never normalized.
Weights
A joint weight, Unorm16x4 in [0, 1].
Implementations§
Trait Implementations§
Source§impl Clone for ChannelEncoding
impl Clone for ChannelEncoding
impl Copy for ChannelEncoding
Source§impl Debug for ChannelEncoding
impl Debug for ChannelEncoding
impl Eq for ChannelEncoding
Source§impl Hash for ChannelEncoding
impl Hash for ChannelEncoding
Source§impl PartialEq for ChannelEncoding
impl PartialEq for ChannelEncoding
impl StructuralPartialEq for ChannelEncoding
Auto Trait Implementations§
impl Forget for ChannelEncoding
impl Freeze for ChannelEncoding
impl RefUnwindSafe for ChannelEncoding
impl Send for ChannelEncoding
impl Sync for ChannelEncoding
impl Unpin for ChannelEncoding
impl UnsafeUnpin for ChannelEncoding
impl UnwindSafe for ChannelEncoding
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more