Transmission, volume, and dispersion
Transparent materials transmit light through a surface; thickness, absorption, and wavelength separation describe glass and colored volumes.
Configuration​
import {Model} from '@luma.gl/engine/api';
import {createPBRMaterial, type PBRMaterial} from '@luma.gl/engine/materials';
const material: PBRMaterial = createPBRMaterial(device, {
uniforms: {
metallicRoughnessValues: [0, 0.05],
transmissionFactor: 1,
ior: 1.5,
thicknessFactor: 0.5,
attenuationColor: [0.8, 0.95, 1],
attenuationDistance: 2,
dispersion: 0.1
}
});
// modelProps contains your existing shaders, geometry, and buffer layout.
const model = new Model(device, {
...modelProps,
material,
defines: {...modelProps.defines, USE_MATERIAL_EXTENSIONS: true}
});
The inline viewer captures opaque scene color before drawing transmissive surfaces. Thin glass shows the background in place. A volume with nonzero thickness displaces the background according to its IOR.
See the focused guides for volume absorption and dispersion for separate reference tables and curated sample subsets.
Parameters​
| Parameter | Default | Description |
|---|---|---|
transmissionFactor | 0 | Fraction of light transmitted through the surface, in the range 0–1. |
transmissionMapEnabled | false | Enables transmission texture sampling. |
ior | 1.5 | Index of refraction of the dielectric material. |
thicknessFactor | 0 | Volume thickness scale in model-space units. |
attenuationColor | [1, 1, 1] | RGB transmittance color at the attenuation distance. |
attenuationDistance | 1e9 | Distance through the volume associated with the attenuation color. |
dispersion | 0 | Chromatic transmission spread, expressed as 20 divided by the Abbe number. |
Texture bindings​
| Field | Model define | Description |
|---|---|---|
pbr_transmissionSampler | HAS_TRANSMISSIONMAP: true | Texture resource for the transmission slot. |
pbr_thicknessSampler | HAS_THICKNESSMAP: true | Texture resource for the thickness slot. |
Enable USE_MATERIAL_EXTENSIONS on custom models. The glTF importer enables it automatically.
See Using PBR materials for material setup.
Remarks​
KHR_materials_transmissionsupplies the transmission factor and texture.KHR_materials_volumeadds thickness and absorption, andKHR_materials_dispersionadds wavelength-dependent refraction.