pub struct TextureInner {Show 23 fields
pub width: u32,
pub height: u32,
pub data: Option<Vec<u8>>,
pub color_space: ColorSpace,
pub flip_y: bool,
pub generate_mipmaps: bool,
pub mipmaps: Vec<Image>,
pub wrap_s: Wrapping,
pub wrap_t: Wrapping,
pub mag_filter: TextureFilter,
pub min_filter: MinFilter,
pub anisotropy: u16,
pub offset: Vector2,
pub repeat: Vector2,
pub center: Vector2,
pub rotation: f64,
pub matrix: Matrix3,
pub channel: usize,
pub format: TextureFormat,
pub version: u32,
pub depth: u32,
pub premultiply_alpha: bool,
pub is_storage: bool,
/* private fields */
}Expand description
The state behind a Texture handle.
Fields§
§width: u32texture.image.width.
height: u32texture.image.height.
data: Option<Vec<u8>>RGBA8 rows, top-down as decoded. None for a render-target texture.
color_space: ColorSpacetexture.colorSpace.
flip_y: booltexture.flipY.
generate_mipmaps: booltexture.generateMipmaps.
mipmaps: Vec<Image>Texture.mipmaps — levels supplied by the page or the file, level 0
first. When there are any they are the whole mip chain:
Textures.getMipLevels() takes its count from them and nothing is
generated on top (webgpu_materials_texture_manualmipmap paints each
level a different colour; a CompressedTexture or a KTX2 DataTexture
brings its own, and a block-compressed format could not be rendered
into anyway). Each level is in the texture’s format, top row first.
wrap_s: Wrappingtexture.wrapS.
wrap_t: Wrappingtexture.wrapT.
mag_filter: TextureFiltertexture.magFilter.
min_filter: MinFiltertexture.minFilter.
anisotropy: u16texture.anisotropy.
offset: Vector2Texture.offset / .repeat / .center / .rotation —
updateMatrix()’s inputs.
repeat: Vector2texture.repeat.
center: Vector2texture.center.
rotation: f64texture.rotation.
matrix: Matrix3Texture.matrix, kept in step with the four above — unless
Texture::set_matrix has overridden it.
channel: usizeTexture.channel — which uv attribute TextureNode.getDefaultUV()
samples along: 0 is uv, 1 is uv1. GLTFLoader sets it from a
texture reference’s texCoord.
format: TextureFormatThe format to use if the renderer has to create it (render targets).
version: u32Texture.version — “starts at 0 and counts how many times
needsUpdate is set to true”. Part of the renderer’s texture cache
key, exactly as Material.version is part of the program cache key.
depth: u32image.depth of a CompressedArrayTexture — the layer count. Zero
for every 2-D texture, which is what marks this one as an array: it
is bound as texture_2d_array<f32> and sampled with a layer index.
premultiply_alpha: boolTexture.premultiplyAlpha. Only KTX2Loader sets it, from the DFD’s
KHR_DF_FLAG_ALPHA_PREMULTIPLIED; it is recorded, not acted on — three’s
WebGPU backend ignores it for compressed uploads as well.
is_storage: booltexture.isStorageTexture — a Texture::storage: created with
STORAGE_BINDING, never uploaded to, written by a compute kernel’s
textureStore().
Trait Implementations§
Source§impl Debug for TextureInner
The derived Debug printed every byte of data — megabytes for an SDF
atlas, and the program cache key used to be a format!( "{:?}" ) of a
binding description that reaches here. The length stands in for the pixels.
impl Debug for TextureInner
The derived Debug printed every byte of data — megabytes for an SDF
atlas, and the program cache key used to be a format!( "{:?}" ) of a
binding description that reaches here. The length stands in for the pixels.