Thin-Walled Transmission for glTF Shaders

This article explores the technical mechanisms in the glTF 2.0 ecosystem that enable thin-walled transmission for materials such as hollow glass, soap bubbles, and plant leaves. By combining standard PBR properties with specific vendor-neutral extensions, real-time renderers can simulate light passing through infinitesimal surfaces without calculating heavy volumetric refraction or interior absorption.

The Role of KHR_materials_transmission

The foundation of light pass-through in glTF is the KHR_materials_transmission extension. In the default metallic-roughness model, light that is not reflected by a dielectric surface is absorbed as diffuse reflection. KHR_materials_transmission introduces a transmissionFactor and a transmissionTexture that redirect non-reflected specular light through the surface rather than converting it to diffuse color.

For thin-walled objects, transmission governs the fraction of incident light that penetrates the outer boundary. When roughness is low, the object appears transparent like a clean bubble; when roughness is higher, transmitted light blurs across the surface.

Zero Thickness via KHR_materials_volume

Standard transmissive objects represent solid volumes where light refracts, changes direction based on Snell's Law, and attenuates over distance. For hollow bubbles or thin sheets of paper and foliage, tracing internal refraction paths is physically inaccurate and computationally wasteful.

The KHR_materials_volume extension controls the internal space of an object. The key mechanism for thin-walled rendering is defining a thicknessFactor of 0.0:

  • Disabling Ray Bending: A thickness of zero signals to the renderer that the mesh represents a double-boundary shell with negligible distance between surfaces. Renderers skip ray displacement (refraction shift), ensuring the background is not magnified or distorted as it would be through a solid glass sphere.
  • Eliminating Absorption: Internal attenuation, defined by attenuationColor and attenuationDistance, is ignored when thickness is zero, preventing the interior of a hollow bubble from darkening.

If KHR_materials_volume is omitted entirely while KHR_materials_transmission is active, glTF renderers default to treating the surface as an infinitely thin sheet.

Diffuse Light and Foliage via KHR_materials_diffuse_transmission

While hollow bubbles rely on specular transmission (clear or frosted transparency), biological structures like leaves require diffuse transmission (translucency).

The KHR_materials_diffuse_transmission extension simulates subsurface light penetration through thin membranes. When light hits the front of a leaf, a portion scatters through the interior and exits diffusely on the back side. This mechanism allows backlit leaves to glow realistically in sunlight without the performance overhead of full subsurface scattering (BSSRDF) algorithms.

Fresnel Boundaries with KHR_materials_ior

Thin-walled transmission relies on the Index of Refraction (IOR) defined by KHR_materials_ior to calculate view-dependent reflections:

  1. Dual-Boundary Approximation: Even though geometry has zero thickness, real-world thin films have two air-to-medium interfaces. Shaders account for reflections occurring at both the entry and exit points.
  2. Grazing Angles: At perpendicular angles, transmission dominates, making bubbles appear mostly transparent. At glancing angles, Fresnel equations increase surface reflectance, producing the bright, crisp edges characteristic of soap bubbles and hollow glass.