Anisotropic reflection
Anisotropic reflection stretches highlights along a surface direction, useful for brushed metal and directional surface finishes.
Configuration​
import {Model} from '@luma.gl/engine/api';
import {createPBRMaterial, type PBRMaterial} from '@luma.gl/engine/materials';
const material: PBRMaterial = createPBRMaterial(device, {
uniforms: {
anisotropyStrength: 0.8,
anisotropyRotation: 0.5,
anisotropyDirection: [1, 0]
}
});
// modelProps contains your existing shaders, geometry, and buffer layout.
const model = new Model(device, {
...modelProps,
material,
defines: {...modelProps.defines, USE_MATERIAL_EXTENSIONS: true}
});
The shared shader approximates directional highlights and image-based lighting response; results depend on the surface tangent frame.
Parameters​
| Parameter | Default | Description |
|---|---|---|
anisotropyStrength | 0 | Strength of directional reflection, in the range 0–1. |
anisotropyRotation | 0 | Rotation of the anisotropy direction in radians. |
anisotropyDirection | [1, 0] | Two-component direction in the surface tangent frame. |
anisotropyMapEnabled | false | Enables anisotropy texture sampling. |
Texture bindings​
| Field | Model define | Description |
|---|---|---|
pbr_anisotropySampler | HAS_ANISOTROPYMAP: true | Texture resource for the anisotropy slot. |
Enable USE_MATERIAL_EXTENSIONS on custom models. The glTF importer enables it automatically.
See Using PBR materials for material setup.
Remarks​
KHR_materials_anisotropysupplies strength, rotation, and an optional direction map.