pub struct Texture {
pub image: Arc<Image>,
pub tint: V3,
pub alpha_cutoff: Option<f32>,
}Expand description
A material’s texture: the picture and how it is laid on.
Fields§
§image: Arc<Image>§tint: V3Multiplies the picture (in linear light), in display values: glTF’s base colour factor; white for the other formats, whose viewers in Eagle replace the material colour with the picture.
alpha_cutoff: Option<f32>Pixels with alpha below this are not drawn (glTF’s MASK mode);
None draws every pixel opaque.
Implementations§
Source§impl Texture
impl Texture
Sourcepub fn sample(&self, uv: [f32; 2]) -> [f32; 4]
pub fn sample(&self, uv: [f32; 2]) -> [f32; 4]
The picture at uv (picture space, 0..1 across it), filtered
bilinearly in linear light, as display values and straight alpha.
The tint is not applied.
Sourcepub fn sample_data(&self, uv: [f32; 2]) -> V3
pub fn sample_data(&self, uv: [f32; 2]) -> V3
The map’s stored values at uv, 0..1, filtered bilinearly as they
are: normals and heights are data, and Eagle’s viewer takes emissive
maps the same way. Alpha plays no part.
Trait Implementations§
impl StructuralPartialEq for Texture
Auto Trait Implementations§
impl Freeze for Texture
impl RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl UnsafeUnpin for Texture
impl UnwindSafe for Texture
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
Mutably borrows from an owned value. Read more
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,
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> ⓘ
Converts
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> ⓘ
Converts
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