glTF Iridescence Thickness and Color Parameters

In glTF 2.0, thin-film interference is standardized through the KHR_materials_iridescence extension, which simulates optical effects like soap bubbles, beetle shells, and tempered metal. This article breaks down the specific parameters governing film thickness and the resulting interference color shifts, detailing how properties such as thickness bounds, texture maps, and indices of refraction interact to produce physically based iridescent hues.

Defining Film Thickness

The physical thickness of the thin-film layer dictates which wavelengths of light undergo constructive and destructive interference. In the KHR_materials_iridescence extension, thickness is defined in nanometers (nm) using three core parameters:

  • iridescenceThicknessMinimum: A floating-point value specifying the lower bound of the thin film's thickness in nanometers. The default value is 100.0 nm.
  • iridescenceThicknessMaximum: A floating-point value specifying the upper bound of the thin film's thickness in nanometers. The default value is 400.0 nm.
  • iridescenceThicknessTexture: A texture that spatially varies the film thickness across the mesh surface. By specification, the thickness data is read from the green (G) channel.

When a thickness texture is supplied, the actual thickness (\(d\)) at any given texel is determined by linear interpolation between the minimum and maximum boundaries:

\[d = \text{iridescenceThicknessMinimum} + \text{Texture.g} \times (\text{iridescenceThicknessMaximum} - \text{iridescenceThicknessMinimum})\]

If no texture is provided, the film thickness defaults to iridescenceThicknessMaximum. Visible light wavelengths range between roughly 380 nm and 750 nm, meaning thicknesses configured between 100 nm and 1000 nm produce the most dramatic color transitions.

Parameters Driving Interference Color Shifts

Interference color shifts—the shifting spectrum of colors seen as the viewing angle or lighting changes—are governed by the optical path difference (OPD). In glTF, this behavior is determined by the following parameters:

  • iridescenceIor: The index of refraction (IOR) of the thin-film layer itself. It defaults to 1.3. A higher thin-film IOR increases the optical density, slowing light down inside the layer and increasing the phase shift between the light reflected from the top surface and the light reflected from the bottom surface.
  • Base Material IOR: Provided by the core material or the KHR_materials_ior extension (defaulting to 1.5). The relationship between iridescenceIor and the base substrate's IOR determines whether light undergoes a \(180^\circ\) phase inversion at the film-substrate interface, fundamentally dictating whether wavelengths cancel out or reinforce one another.
  • iridescenceFactor: A scalar (0.0 to 1.0) defining the overall intensity of the iridescence effect. It can be modulated spatially using the red (R) channel of the iridescenceTexture.

The Mechanism of the Color Shift

The perceived color shift is not driven by an RGB tint parameter, but is an emergent physical property derived from:

  1. Thickness (\(d\)): Larger thickness values cycle through multiple orders of spectral interference, altering which distinct wavelengths (colors) reflect at peak intensity.
  2. Thin-Film Refraction (iridescenceIor): Modifies the path length of the refracted ray inside the film.
  3. Viewing Angle (\(\theta\)): As the angle of incidence increases (glancing angles), the path of light through the thin film shortens relative to the surface normal, shifting the constructive interference toward shorter wavelengths (a blueshift).