pub struct TextureMaterial3d { /* private fields */ }Expand description
Cheap immutable unlit material sharing one texture and filter state.
Sampled straight-linear RGBA multiplies vertex color, this tint and the object’s surface tint. Surface style selects alpha coverage, depth-write behavior and projected sidedness. No lighting is implied.
Implementations§
Source§impl TextureMaterial3d
impl TextureMaterial3d
Sourcepub fn new(
texture: &Texture3d,
sampling: ImageSampling,
tint: Color,
) -> Result<Self, Texture3dError>
pub fn new( texture: &Texture3d, sampling: ImageSampling, tint: Color, ) -> Result<Self, Texture3dError>
Creates a legacy opaque material; tint must be normalized with alpha one, and every source texel must have alpha 255, even for alpha-capable textures.
Sourcepub fn with_alpha(
texture: &Texture3d,
sampling: ImageSampling,
tint: Color,
) -> Result<Self, Texture3dError>
pub fn with_alpha( texture: &Texture3d, sampling: ImageSampling, tint: Color, ) -> Result<Self, Texture3dError>
Creates a material preserving normalized straight-linear tint and texture alpha. Coverage/depth behavior is chosen by each object’s surface style.
Sourcepub fn with_uv_transform(self, transform: TextureUvTransform3d) -> Self
pub fn with_uv_transform(self, transform: TextureUvTransform3d) -> Self
Applies validated continuous UV scale then offset, before hardware addressing.
Sourcepub fn with_address_mode(self, mode: TextureAddressMode3d) -> Self
pub fn with_address_mode(self, mode: TextureAddressMode3d) -> Self
Selects addressing of the whole texture; Repeat requires an isolated image for tile safety.
Sourcepub fn with_texture(&self, texture: &Texture3d) -> Result<Self, Texture3dError>
pub fn with_texture(&self, texture: &Texture3d) -> Result<Self, Texture3dError>
Rebinds a new texture snapshot while preserving tint, filtering, UV and alpha policy. Legacy opaque materials reject a new snapshot containing nonopaque texels.
Sourcepub const fn uv_transform(&self) -> TextureUvTransform3d
pub const fn uv_transform(&self) -> TextureUvTransform3d
Returns continuous pre-addressing coordinate transformation.
Sourcepub const fn address_mode(&self) -> TextureAddressMode3d
pub const fn address_mode(&self) -> TextureAddressMode3d
Returns complete-image clamp/repeat addressing.
Sourcepub const fn sampling(&self) -> ImageSampling
pub const fn sampling(&self) -> ImageSampling
Returns nearest or linear filtering. Generated chains use nearest-mip or trilinear sampling respectively, with derivative-selected LOD. Alpha-aware mip generation does not make straight-RGBA bilinear filtering fringe-free.