Texture coordinates and transforms
Independent texture coordinate sets and transforms let each surface map use its own placement, rotation, and scale.
Configuration​
import {createPBRMaterial, type PBRMaterial} from '@luma.gl/engine/materials';
const material: PBRMaterial = createPBRMaterial(device, {
uniforms: {
baseColorUVSet: 0,
baseColorUVTransform: [2, 0, 0, 0, 2, 0, 0.25, 0, 1]
}
});
// Pass material to a compatible Model through its material prop.
The example matrix doubles texture tiling and offsets U by 0.25. Runtime transforms must not be combined with duplicate loader-side UV baking. Animated texture-set switches and TEXCOORD_2+ slots are unsupported.
Parameters​
| Parameter | Default | Description |
|---|---|---|
baseColorUVSet | 0 | Selects UV set 0 or 1 for the base-color texture. |
baseColorUVTransform | Identity matrix | Column-major 3×3 transform of base-color texture coordinates. |
Each supported texture slot has its own UVSet and UVTransform fields, including
normalUVSet, normalUVTransform, metallicRoughnessUVSet, and
metallicRoughnessUVTransform. Transforms and coordinate-set selection are independent per slot.
See Using PBR materials for material setup.
Remarks​
- Core glTF
texCoordselects a UV set for each texture.KHR_texture_transformadds offset, rotation, scale, and an optional UV set override.