glTF KHR_materials_volume Heterogeneous Scattering

This article examines how the glTF extension KHR_materials_volume approaches interior light scattering, specifically focusing on its technical capabilities, architectural scope, and inherent limitations regarding heterogeneous volumetric media. It details the extension's reliance on homogeneous models, how thickness mapping works, and why true heterogeneous interior scattering falls outside its current specification.

The KHR_materials_volume extension does not natively support true heterogeneous interior scattering. Instead, the specification is designed around a homogeneous medium model, assuming that optical properties remain uniform throughout the interior of the bounded 3D mesh.

The Homogeneous Medium Model

In KHR_materials_volume, light interaction through the interior of an object is primarily governed by absorption via the Beer-Lambert law. The parameters defining this interaction include:

  • attenuationColor: The color that white light turns toward after traveling the specified attenuation distance.
  • attenuationDistance: The average distance that light travels through the volume before its intensity is reduced by absorption according to the attenuation color.

Because both attenuationColor and attenuationDistance are defined as single, uniform values for the entire material, the interior medium cannot vary in density, absorption, or scattering behavior across three-dimensional space. The specification does not include volumetric grids, 3D textures, or OpenVDB-like spatial data structures required to represent true interior heterogeneity.

Scattering vs. Absorption

The extension focuses on light attenuation (absorption) rather than full phase-function-driven volumetric scattering. It does not provide parameters for in-scattering, out-scattering coefficients, or directional scattering phase functions (such as the Henyey-Greenstein phase function). When light enters a surface using KHR_materials_volume, it is transmitted and absorbed linearly along straight refraction paths, without simulating multiple internal bounces or particulate scattering inside the volume.

Surface-Level Variations vs. True Volumetric Heterogeneity

While true internal volumetric variation is unsupported, the extension allows surface-driven variation using the thicknessTexture and thicknessFactor parameters.

  • A thicknessTexture assigns varying thickness values across the 2D surface of the geometry.
  • This texture dictates the virtual optical thickness of the object at the point of ray entry.

Although this creates visual variation across different parts of a mesh—making thin regions appear clearer and thicker regions appear denser—this is purely a surface-boundary approximation. The internal density and composition remain completely constant; only the distance light is assumed to travel through the medium changes based on the 2D texture map.

Representing Heterogeneous Volumes in glTF

To simulate heterogeneous media within the current glTF ecosystem, developers must rely on indirect techniques:

  • Geometric Subdivision: Splitting an object into multiple nested shells or separate internal meshes, each assigned a different KHR_materials_volume configuration to fake density gradients.
  • Custom Shaders and Extensions: Utilizing engine-specific volumetric shaders or proprietary extensions capable of reading 3D textures or voxel grids directly.

In summary, KHR_materials_volume treats interior volumes as strictly homogeneous, limiting interior light interactions to uniform absorption and relying on 2D thickness maps rather than true heterogeneous volumetric scattering.