Metallic-Roughness Workflow in glTF PBR Materials
The metallic-roughness workflow is the standard Physically Based Rendering (PBR) model defined by the glTF 2.0 specification to achieve predictable, photorealistic surface rendering across real-time 3D engines. This workflow relies on standard physical principles such as energy conservation and microfacet theory to simulate how light interacts with matter. Instead of relying on arbitrary shading parameters, it defines a surface through a combination of a base color, a metalness scalar, and a roughness scalar, standardizing material definitions across web, mobile, and desktop runtimes.
Core Texture Channels and Data Packing
The glTF 2.0 specification optimizes performance and memory usage by packing multiple material properties into shared texture files:
- Base Color (
baseColorTexture): An sRGB-encoded texture (or linear factor) defining surface color. For non-metallic surfaces, this represents diffuse albedo. For metallic surfaces, it represents specular reflectance. It also includes an alpha channel for transparency. - Metallic-Roughness
(
metallicRoughnessTexture): A linear RGB texture that packs two critical PBR parameters:- Green Channel: Roughness values.
- Blue Channel: Metallic values.
- Red Channel: Often repurposed to store Ambient Occlusion (AO), creating a combined Occlusion-Roughness-Metallic (ORM) map.
The Role of the Metallic Parameter
The metallic parameter determines whether a surface behaves as a dielectric (insulator) or a conductor (metal). In nature, materials are almost strictly either dielectric or metallic, meaning values are typically close to 0.0 or 1.0.
- Dielectric Surfaces (Metallic = 0.0): The material absorbs and scatters light beneath the surface, producing diffuse reflections governed by the Base Color. The specular reflectance at normal incidence (\(F_0\)) is fixed at a default value of approximately 4% (0.04), which accurately models common non-metals like plastic, wood, stone, and glass.
- Metallic Surfaces (Metallic = 1.0): Conductors have no subsurface scattering; all diffuse reflection is eliminated. Light is entirely reflected or absorbed at the surface. The Base Color directly defines the tint and intensity of the specular reflectance (\(F_0\)).
- Intermediate Values (0.0 < Metallic < 1.0): Used sparingly to represent transitions, such as thin coatings of dust, oxidation, or rust on top of a metal surface.
The Role of the Roughness Parameter
Roughness controls the microfacet distribution of the surface, typically modeled using the Trowbridge-Reitz (GGX) distribution. It dictates the sharpness or blurriness of specular reflections.
- Low Roughness (near 0.0): Represents an optically smooth surface. Microfacets align uniformly, concentrating reflected light into sharp, mirror-like specular highlights.
- High Roughness (near 1.0): Represents a microscopically irregular surface. Microfacets scatter reflected rays in divergent directions, resulting in broad, blurred specular highlights with lower peak intensity.
In glTF, roughness is supplied as a linear perceptual value. The rendering engine squares this value (\(\alpha = \text{roughness}^2\)) during shading calculations to achieve a more perceptually uniform transition between glossy and matte appearances.
Energy Conservation and Advantages
A key principle enforced by the metallic-roughness model in glTF is the conservation of energy: an object cannot reflect more light than it receives. As roughness increases, reflection spreads across a larger area while diminishing in intensity. As metallic values increase, diffuse reflection automatically falls to zero to balance the increased specular reflection.
This workflow prevents artists from authoring physically impossible materials, ensuring that glTF 3D assets render consistently and believably under varying lighting environments and across different rendering engines.