Struct gltf_json::extensions::texture::TextureTransform
source · pub struct TextureTransform {
pub offset: TextureTransformOffset,
pub rotation: TextureTransformRotation,
pub scale: TextureTransformScale,
pub tex_coord: Option<u32>,
pub extras: Extras,
}
Expand description
Many techniques can be used to optimize resource usage for a 3d scene. Chief among them is the ability to minimize the number of textures the GPU must load. To achieve this, many engines encourage packing many objects’ low-resolution textures into a single large texture atlas. The region of the resulting atlas that corresponds with each object is then defined by vertical and horizontal offsets, and the width and height of the region.
To support this use case, this extension adds offset
, rotation
, and scale
properties to textureInfo structures.
These properties would typically be implemented as an affine transform on the UV coordinates.
Fields§
§offset: TextureTransformOffset
§rotation: TextureTransformRotation
Rotate the UVs by this many radians counter-clockwise around the origin. This is equivalent to a similar rotation of the image clockwise.
scale: TextureTransformScale
The scale factor applied to the components of the UV coordinates.
tex_coord: Option<u32>
Overrides the textureInfo texCoord value if supplied, and if this extension is supported.
extras: Extras
Optional application specific data.
Trait Implementations§
source§impl Clone for TextureTransform
impl Clone for TextureTransform
source§fn clone(&self) -> TextureTransform
fn clone(&self) -> TextureTransform
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more