Skip to main content

Volume Scattering

Volume scattering approximates light redirected inside a material using local thickness and a directional phase response.

GitHub
0.0s
Light scatters through the skull according to the material’s local thickness.

Configuration​

Enable USE_MATERIAL_EXTENSIONS: true in the compatible model's defines.

The following fields update an existing PBR material; see Materials guide.

material.setProps({
pbrMaterial: {
metallicRoughnessValues: [0, 0.4],
thicknessFactor: 0.6,
attenuationDistance: 0.6,
diffuseTransmissionFactor: 0.7,
multiscatterColorFactor: [0.9, 0.35, 0.18],
scatterAnisotropy: 0.25
}
});

Parameters​

ParameterDefaultDescription
multiscatterColorFactor[0, 0, 0]Linear scattering color.
pbr_multiscatterColorSamplerUnboundOptional sRGB scattering color texture.
scatterAnisotropy0Directional preference, from −1 to 1.
thicknessFactor0Local material thickness.
attenuationDistance1e9Distance over which light is attenuated.

attenuationDistance controls the optical distance over which scattering becomes significant, using the same units as thickness. Set it to a value comparable to thicknessFactor: the example uses 0.6 for both, giving a scattering probability of approximately 0.63 from 1 - exp(-thickness / attenuationDistance). The default distance of 1e9 makes volume scattering effectively invisible at this thickness. Increasing the distance weakens scattering for a fixed thickness; decreasing it strengthens scattering.

Remarks​

  • The experimental KHR_materials_volume_scatter extension supplies scattering color and anisotropy. luma.gl approximates scattering locally using thickness.