BRDFs and Physically Based Shading
Put a billiard ball, a brushed-steel spoon and a sheet of paper on the same table under the same
lamp. The ball shows a tight, bright highlight; the spoon smears that highlight into a long streak;
the paper has no highlight at all, just an even glow. Nothing about the light changed — only the
surface changed how it redistributes the light it receives. This page is
about the one function that captures that difference for any material: the
BRDF, and the physically-based recipe modern renderers build on top of it.
You have already met ad-hoc shading — the
diffuse + specular Phong lighting
that lit early real-time graphics by hand-tuning knobs until it "looked OK". Here we do it
physically: we insist the surface obeys the same conservation laws real materials obey, and
those constraints are exactly what make a material look convincing under any lighting rather
than only the one scene it was tuned in. The BRDF is also the material half of
the rendering equation.
What the BRDF actually is
Stand at a point on a surface. Light arrives from some incoming direction
\omega_i, and a camera looks back along some outgoing direction
\omega_o. The Bidirectional Reflectance Distribution Function
answers one question: of the light landing from \omega_i, how much heads
out toward \omega_o? Precisely, it is the ratio of the reflected
radiance leaving in \omega_o to the irradiance arriving
from \omega_i:
f_r(\omega_i, \omega_o) \;=\; \frac{dL_o(\omega_o)}{dE_i(\omega_i)} \;=\; \frac{dL_o(\omega_o)}{L_i(\omega_i)\,\cos\theta_i\,d\omega_i}.
That \cos\theta_i (with \theta_i the angle
between \omega_i and the surface normal) is Lambert's cosine:
light hitting at a glancing angle spreads its energy over more surface, so it delivers less irradiance
per unit area. The BRDF is a function of four angles (two directions, each a hemisphere
coordinate), and its units are inverse steradians. Every material — chalk, gold, car paint, skin — is
just a different shape of f_r.
A BRDF that describes a real, passive surface must satisfy all three:
- Non-negativity: f_r(\omega_i,\omega_o) \ge 0. A
surface cannot reflect a negative amount of light.
- Helmholtz reciprocity:
f_r(\omega_i,\omega_o) = f_r(\omega_o,\omega_i). Swap the roles of light
and camera and the value is unchanged — a consequence of time-reversibility of light paths, and
what makes bidirectional path tracing valid.
- Energy conservation: for every incoming direction, the total reflected over the
hemisphere cannot exceed what came in:
\int_{\Omega} f_r(\omega_i,\omega_o)\,\cos\theta_o\,d\omega_o \le 1. A
surface may absorb energy; it may never manufacture it.
The two extremes: diffuse and specular
The simplest legal BRDF is the Lambertian (perfectly diffuse) surface: it scatters
incoming light equally in all outgoing directions, so f_r is a
constant that does not depend on \omega_i or \omega_o
at all. If the surface reflects a fraction \rho of the light it receives
(its albedo, with 0 \le \rho \le 1), energy conservation pins the
constant exactly:
f_r^{\text{diffuse}} = \frac{\rho}{\pi}.
Where does the \pi come from? Integrate a constant
c against \cos\theta_o over the hemisphere and
you get c\pi; forcing that to equal \rho gives
c = \rho/\pi. Beginners who forget the \pi get a
surface that is too bright by a factor of about three — a classic energy leak.
The opposite extreme is a perfect mirror (specular): light from
\omega_i leaves in exactly one direction, the mirror reflection, and
nowhere else. Its BRDF is a spike — a delta function — infinitely tall and infinitely thin. Real
materials live between these two: a glossy surface has a diffuse base plus a specular
lobe that is a blurred, finite-width version of the mirror spike. The width of that
lobe is the whole game, and physically-based rendering earns the blur from first principles.
Microfacets: a rough surface is a sea of tiny mirrors
Physically Based Rendering (PBR) explains gloss with one idea: zoom in far enough and a "rough"
surface is not smooth at all — it is a landscape of millions of microscopic facets, each a
perfect mirror pointing in a slightly different direction. You see a broad soft highlight not
because any facet blurs light, but because the facets' normals are scattered, so different
facets flash the light toward your eye from a whole range of surface points. A polished surface has
facets nearly aligned with the macroscopic normal (a tight highlight); a rough surface has wildly
varying facet normals (a wide, soft sheen).
The Cook–Torrance microfacet BRDF turns that picture into three factors. Only facets
whose normal points exactly along the half-vector
h = \tfrac{\omega_i + \omega_o}{\lvert \omega_i + \omega_o \rvert} can
mirror light from \omega_i to \omega_o. So the
specular BRDF is:
f_r^{\text{spec}}(\omega_i,\omega_o) \;=\; \frac{D(h)\,F(\omega_o,h)\,G(\omega_i,\omega_o)}{4\,\cos\theta_i\,\cos\theta_o}.
- D — the normal distribution: what fraction of facets point along
h. Modern renderers use GGX / Trowbridge–Reitz,
controlled by a roughness parameter \alpha. Small
\alpha concentrates facets near the normal (sharp highlight); large
\alpha spreads them out (broad lobe). GGX is prized for its long,
realistic tails.
- F — Fresnel reflectance: the fraction of light reflected rather than
transmitted, which rises toward 1 at grazing angles. Cheaply approximated by
Schlick:
F(\theta) = F_0 + (1 - F_0)(1 - \cos\theta)^5, where
F_0 is the head-on reflectance.
- G — geometry / shadowing–masking: facets in a rough surface hide behind one
another, blocking incoming light (shadowing) or outgoing light (masking). G
accounts for that self-occlusion, and matters most at grazing angles.
The 4\cos\theta_i\cos\theta_o denominator is the geometric bookkeeping that
converts between facet-space and surface-space solid angles. Crucially, this BRDF is built to be
reciprocal and energy-conserving by construction — the physics is baked in, not tuned in.
Watch the lobe widen
Below is a cross-section of the GGX distribution D as a function of the
angle between a facet's normal and the surface normal. Drag the roughness slider. At
low roughness the curve is a tall, narrow spike — nearly all facets aligned, so the highlight is a
crisp mirror dot. As roughness climbs the peak collapses and the curve flattens into a broad hump:
the same total energy, now smeared across a wide range of angles — the sharp highlight melts into a
soft satin sheen. That single knob, from \alpha \to 0 (chrome) to
\alpha \to 1 (chalky), sweeps a material through its entire range of gloss.
Notice the area under the curve stays roughly fixed as it spreads — that is energy conservation
visible as a picture. A rough surface does not reflect less specular light overall; it just
distributes the same light over a wider cone, so any one direction gets a dimmer share.
Worked example: roughness, and the grazing-angle trick
Widening the lobe. Take a GGX surface and push
\alpha from 0.05 to
0.6. At \alpha = 0.05 the distribution's peak is
enormous — the highlight is a pinpoint reflection of the light source, a chrome bearing. At
\alpha = 0.6 the peak value drops by more than an order of magnitude and
the lobe fans out over tens of degrees: the light source is no longer recognisable, just a soft bright
smear the size of a fist. The transition is smooth and monotone — no re-tuning, no per-light hacks —
which is exactly why one roughness map can describe a scuffed metal panel that reads correctly under a
studio softbox and a hard noon sun.
Fresnel makes even a rough surface a mirror at grazing angles. Take a rough dielectric
— unpolished plastic, dry asphalt — with a tiny head-on reflectance
F_0 \approx 0.04 (about 4%, typical of non-metals). Look straight down at
it (\theta = 0): Schlick gives
F = 0.04, barely reflective, and you see its dull diffuse colour. Now slide
your eye to a grazing angle, \theta = 80^\circ, so
\cos\theta \approx 0.174:
F = 0.04 + (1 - 0.04)(1 - 0.174)^5 \approx 0.04 + 0.96 \times 0.385 \approx 0.41.
Reflectance has leapt from 4% to about 41% — an order of magnitude — purely from
viewing angle. This is why a dull road turns into a blinding mirror in low evening sun, why the far
edge of a matte table gleams, and why a lake is glassy near the far shore. Every surface, however
rough, becomes mirror-like at a shallow enough angle. Fresnel is the term that captures it, and its
absence is the single most common giveaway of a "fake"-looking render.
The metallic / roughness workflow
PBR's constraints did something quietly revolutionary for artists: they made materials
portable. Because a physically-based BRDF behaves correctly under any lighting,
studios converged on a tiny, intuitive set of authored channels — the metallic/roughness
workflow:
| Channel | Meaning | Effect on the BRDF |
| Base colour (albedo) | The surface's intrinsic colour | Diffuse \rho for dielectrics; tints F_0 for metals |
| Metallic | Is it a conductor? (0 or 1) | Metal: no diffuse, coloured specular (high F_0). Dielectric: diffuse + neutral 4% specular |
| Roughness | Microfacet spread | Sets GGX \alpha — sharp to soft highlight |
Three or four sliders, and the same material dropped into a night street, a sunset, or a spaceship
interior looks like the same stuff every time. Before PBR, a material was tuned to a scene
and broke when the lighting changed; after PBR, a material is a description of a surface, and
the renderer figures out the rest. That consistency — energy conservation plus Fresnel plus a single
roughness knob — is what makes PBR read as "real".
In PBR, metals (conductors) have no diffuse term at all — free electrons
reabsorb any light that would penetrate — and their specular reflectance
F_0 is both high (60–95%) and coloured. Gold's
F_0 is high in red and green but low in blue, so its reflections
are golden. A red apple is a dielectric: its specular highlight is a neutral white
4% (you see the white kitchen window in it, not a red one), and its red comes from the diffuse term
underneath. That is the deep reason the metallic channel is nearly binary — the two physics regimes
genuinely differ, and mixing them is what makes cheap plastic "chrome" look like a toy.
Classic hand-tuned Phong specular is not a legal BRDF. Its normalisation was chosen by eye,
so it is generally not energy-conserving (crank the shininess and a surface can
reflect back more light than it received) and the raw formula is not reciprocal. The
symptom is unmistakable once you know it: the surface seems to glow or gain energy
as the light moves, and a material carefully tuned to look right in one scene looks plastic, blown
out, or dead in the next. There is no single roughness that "just works" everywhere, because the
model isn't grounded in physics — you are forever re-tuning per scene.
The fix is the two constraints this page is built on. Enforce energy conservation
(the diffuse \rho/\pi, a properly normalised GGX, a diffuse/specular balance
that never sums above 1) and you get consistency for free. And never forget Fresnel:
the second-most-common mistake, after leaking energy, is a surface with no grazing-angle brightening —
it stays flatly matte at every angle and instantly reads as CG. Everything is shiny at a glancing
angle. If your render looks "off" and you can't say why, check those two first.