GGX / Trowbridge-Reitz normal distribution
The microfacet normal distribution with a long, heavy tail, popularised for graphics by Walter et al. Its soft halo around the highlight matches measured materials well and it has closed-form visible-normal sampling, so it is the default D term in PBR.
In the family Materials, BRDFs & texturing, microfacet BRDF
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | Built in | MeshStandardMaterial / MeshPhysicalMaterial docs |
| Babylon.js 9.38.0 | Built in | BABYLON.PBRMaterial (GGX NDF is the default microfacet distribution) docs |
| Godot 4.7 | Built in | StandardMaterial3D default specular mode SPECULAR_SCHLICK_GGX docs |
| Unity | Built in | Lit shaders in URP and HDRP docs URP and HDRP. |
| Unreal 5.7 | Built in | Material > Shading Model = Default Lit / Substrate (GGX normal distribution driven by Roughness) docs |
| Blender 5.2 | Built in | Principled BSDF > Distribution = GGX or Multiscatter GGX docs |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
GGX describes the density of microfacet normals with an ellipsoid-derived function: D(h) = a^2 / (pi * ((n.h)^2 (a^2 - 1) + 1)^2), where a = roughness^2 in the common remapping. Compared with Beckmann it falls off polynomially rather than exponentially, giving the characteristic bright core with a faint wide glow. Walter et al. introduced it to graphics (it is the Trowbridge-Reitz distribution from 1975 optics) in the context of rough refraction, and showed how to importance-sample it. In a renderer it appears as the D factor of a Cook-Torrance BRDF; pair it with the height-correlated Smith G for consistency. The anisotropic form replaces a with two axis-aligned roughnesses ax, ay.
When to choose it
Reach for it when
- highlights look plasticky with no long tail
- need a physically based specular lobe for metals
- specular falloff too sharp compared to real materials
- match reflections of rough surfaces seen in photographs
Choose it as the D term of any real-time or offline microfacet specular lobe; it is the de facto standard in glTF, Unreal, Filament and OpenPBR. Prefer plain Beckmann only to match legacy assets. For fabric or velvet, where highlights brighten at grazing angles, prefer Charlie sheen (Estevez-Kulla). For stretched highlights use Anisotropic GGX.
Field marks
- Very low roughness makes D numerically explode near the peak, so clamp roughness (about 0.03-0.045) or you get fireflies and aliased pinpoint highlights
- Long tail can overpower thin dielectric looks, creating a milky halo on glossy plastics
- Without specular antialiasing (toksvig-mipmapping, normal-distribution-filtering) normal-mapped surfaces shimmer
- Single-scattering GGX darkens rough metals; compensate with kulla-conty-multiscatter
Presets
Aluminium, roughness 0.35
{
"color": "#f5f6f6",
"roughness": 0.35,
"metalness": 1
}Attribution: written for this index; colour, IOR and metalness from physicallybased.info (CC0), roughness chosen here · basis: 2
Polished gold
{
"color": "#ffe496",
"roughness": 0.12,
"metalness": 1
}Attribution: written for this index; colour, IOR and metalness from physicallybased.info (CC0), roughness chosen here · basis: 2
GGX / Trowbridge-Reitz microfacet BRDF (WGSL)
{
"ROUGHNESS": 0.28,
"METALNESS": 0.85,
"IOR": 1.5
}Show WGSL (57 lines)
// WebGPU WGSL fragment specimen: GGX NDF + Smith G2 + Schlick Fresnel
const ROUGHNESS: f32 = 0.2800; // P
const METALNESS: f32 = 0.8500; // P
const IOR: f32 = 1.5000; // P
fn d_ggx(nh: f32, a: f32) -> f32 {
let a2 = a * a;
let d = nh * nh * (a2 - 1.0) + 1.0;
return a2 / (3.1415926 * d * d + 1e-5);
}
fn f_schlick(uVal: f32, f0: vec3f) -> vec3f {
return f0 + (vec3f(1.0) - f0) * pow(clamp(1.0 - uVal, 0.0, 1.0), 5.0);
}
fn studio_env(d: vec3f) -> vec3f {
let y = clamp(d.y * 0.5 + 0.5, 0.0, 1.0);
let key = smoothstep(0.82, 0.96, dot(d, normalize(vec3f(0.55, 0.72, 0.42)))) * 2.6;
let rim = smoothstep(0.80, 0.95, dot(d, normalize(vec3f(-0.72, 0.40, 0.56)))) * 1.4;
return mix(vec3f(0.18, 0.19, 0.21), vec3f(0.82, 0.84, 0.86), pow(y, 1.2)) + vec3f(key + rim * 0.85);
}
@fragment
fn fs_main(@builtin(position) pos: vec4f) -> @location(0) vec4f {
let uv = (pos.xy - 0.5 * u.resolution) / u.resolution.y;
let ro = vec3f(0.0, 0.12, 2.6);
let rd = normalize(vec3f(uv.x, -uv.y, -1.45));
let b = dot(ro, rd);
let c = dot(ro, ro) - 0.62;
let h = b * b - c;
if (h < 0.0) {
let bg = mix(vec3f(0.86, 0.87, 0.85), vec3f(0.75, 0.76, 0.78), clamp(-uv.y + 0.5, 0.0, 1.0));
return vec4f(pow(bg, vec3f(1.0 / 2.2)), 1.0);
}
let p = ro + rd * (-b - sqrt(h));
let n = normalize(p);
let v = -rd;
let l = normalize(vec3f(cos(u.time * 0.4) * 0.75, 0.72, 0.62));
let hv = normalize(l + v);
let nl = max(dot(n, l), 0.0);
let nv = max(dot(n, v), 0.001);
let nh = max(dot(n, hv), 0.0);
let vh = max(dot(v, hv), 0.0);
let base = vec3f(0.88, 0.71, 0.46);
let f0s = pow((IOR - 1.0) / (IOR + 1.0), 2.0);
let f0 = mix(vec3f(f0s), base, METALNESS);
let a = max(0.04, ROUGHNESS * ROUGHNESS);
let F = f_schlick(vh, f0);
let D = d_ggx(nh, a);
let G = 1.0 / (4.0 * max(nl * nv, 0.05));
let spec = D * F * G * nl * 2.5;
let diff = (vec3f(1.0) - F) * (1.0 - METALNESS) * base / 3.1415926 * nl * 2.2;
let ibl = studio_env(reflect(-v, n)) * f_schlick(nv, f0) * mix(1.0, 0.25, ROUGHNESS) + studio_env(n) * (1.0 - METALNESS) * base * 0.35;
let col = diff + spec + ibl;
let mapped = (col * (2.51 * col + 0.03)) / (col * (2.43 * col + 0.59) + 0.14);
return vec4f(pow(clamp(mapped, vec3f(0.0), vec3f(1.0)), vec3f(1.0 / 2.2)), 1.0);
}Attribution: written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| ggx-aluminium | Tesla T4 1920x1080 | 1.91× baseline (feather) · 0.063 ms / 0.065 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| ggx-aluminium | NVIDIA L4 1920x1080 | 1.77× baseline (feather) · 0.028 ms / 0.029 ms · 2.2× faster on L4 | opengl-timer-query · Cross-architecture validation |
| ggx-aluminium | NVIDIA A100-SXM4-40GB 1920x1080 | 1.25× baseline (feather) · 0.036 ms / 0.036 ms · 1.7× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): cited by Manifold Next-Event Estimation and Specular Manifold Sampling.
Sources
- primaryBruce Walter, Stephen R. Marschner, Hongsong Li, Kenneth E. Torrance (2007). Microfacet Models for Refraction through Rough Surfaces. Rendering Techniques.Verified via doi.org · 2026-11-29doi:10.2312/egwr/egsr07/195-206
- implementationmrdoob (2010). mrdoob/three.js. JavaScript 3D Library.GitHub API · license MIT · 2026-11-29
- datasetAnton Palmqvist. physicallybased.info. physicallybased.info.Verified via live page · 2026-11-29