Back to Journal

Physically Based Rendering: Materials That Obey Light

Physically based rendering replaces the painter's guesswork with a few honest measurements of a surface, so that one material looks right under noon sun, candlelight and moonlight alike, because it obeys the same rules light does.

For many years real-time materials were painted by feel. An artist would take a texture of a stone wall, nudge a specular slider until the highlight looked plausible under the lights of one particular level, and move on. The material looked right in the room where it was tuned, and somewhat wrong everywhere else, because the numbers it carried described an impression rather than a substance. Under a different sky the same wall might glow like wet plastic or sink into a lifeless grey.

Physically based rendering, usually shortened to PBR, is the name for a change of attitude more than for a single algorithm. Its premise is that a material should be described by properties the real surface actually possesses, how much light it absorbs, how rough it is at a microscopic scale, whether it conducts electricity, and that the renderer, rather than the artist, should work out how those properties respond to whatever light happens to fall on them.

The rewards are consistency and a shared language. A texture artist and a lighting artist who both obey the rules can work apart and still meet in the middle, and an asset made for one scene will behave sensibly in another. The cost is discipline: the maps must contain the right kind of information, and certain old habits, above all painting light directly into colour, must be abandoned. The sections below follow the principles first and the practical maps afterwards.

The Ledger of Light

The first principle is energy conservation, and it is almost embarrassingly simple to state: a surface cannot send out more light than arrives at it. Light that strikes a material is partly reflected from the surface, partly scattered inside and re-emitted as diffuse colour, and partly absorbed as heat. Those portions must add up to no more than the whole. Older shading models broke this rule freely, and their highlights could be brighter than the lamp that produced them.

The consequence for the artist is a coupling between reflection and diffuse colour that the old sliders never enforced. When a surface becomes more reflective, less energy remains for its diffuse response, so polished metal shows almost no diffuse colour at all, while chalk shows almost nothing but. A PBR shader handles this bookkeeping internally. The artist no longer sets the brightness of the highlight; they set the properties of the surface, and the brightness follows.

Roughness enters the ledger in a particular way. A rough surface does not reflect less light than a smooth one of the same material; it reflects the same quantity scattered over a wider range of directions. The microscopic facets of a rough surface point every which way, so the reflection of a lamp spreads into a broad, dim glow, while on a smooth surface the facets agree and the reflection gathers into a small, intense point. The energy is preserved; only its distribution changes.

Fresnel and the Grazing Glance

The second principle concerns angle. Every surface becomes more reflective as it is viewed closer to edge on, an effect named after Augustin Fresnel, who described the behaviour of light at the boundary between materials. Look straight down into a still pond and you see the stones on the bottom; look across it toward the far shore and you see the sky reflected. The water has not changed. Only the angle has.

For common non metals, the reflectance seen when looking straight at the surface is small, roughly four percent for many materials, and it rises toward total reflection as the angle approaches grazing. This is why the rim of a wooden table, a stone floor seen at a low angle, or the edge of a cheek catches a faint sheen even when the surface is dull. PBR shaders compute this automatically, usually with an approximation published by Christophe Schlick that is cheap enough for every pixel.

The practical meaning is that artists should not paint rim highlights or try to imitate this sheen with colour. Doing so double counts an effect the shader already produces, and the painted version is fixed to one view while the real effect moves with the camera. Of all the habits that PBR overturned, the habit of painting what light does, rather than what the surface is, turns out to be the most persistent and the most damaging.

Metals and Everything Else

The third distinction divides the material world into two families. Metals, being conductors, absorb whatever light enters them almost at once, so they have essentially no diffuse colour; all their visible colour comes from reflection, and that reflection is tinted, which is why gold reflects a warm yellow and copper a reddish orange. Non metals, the dielectrics, behave the other way: their reflection is weak and colourless, and their visible colour comes from light scattered beneath the surface.

The metallic workflow encodes this with a single value per texel. A metallic value of 0 marks a dielectric, whose albedo is taken as diffuse colour and whose reflectance is fixed near that four percent; a value of 1 marks a metal, whose albedo is reused as the tint of its reflection. Real surfaces are rarely in between, so metallic maps tend to be mostly black and white, with intermediate grey reserved for transitions such as rust creeping over iron or dust settling on a blade.

The specular workflow describes the same physics with different controls. Instead of a metallic switch, it supplies a separate specular colour map that states the reflectance directly, with the diffuse map holding only the scattered colour. It offers more freedom, including reflectance values the metallic workflow cannot express, and with that freedom more ways to produce materials that violate the rules. Both workflows can represent nearly every real surface, and the choice is often a matter of studio habit and the tools that produced the textures.

The Maps and What They Hold

The albedo map holds the base colour of the surface with all lighting stripped away. It should look flat and slightly dull, like a photograph taken under an overcast sky with no shadows and no highlights, because the renderer will add those itself. A brick texture with dark baked shadows in the mortar, lit by the engine from a different direction, ends up with two sets of shadows that disagree, and the eye detects the contradiction at once even when it cannot name it.

Smoothness, or its inverse roughness, describes the microscopic texture that governs the spread of reflections. Unity uses smoothness, with 1 meaning a perfect mirror and 0 meaning a completely matte surface; many other tools and engines author roughness, so a texture exported from one must sometimes be inverted for the other. A smoothness map is where most of a material's character lives: the polished centre of a worn step, the duller hollows where grime collects, the bright streak of a fingerprint on steel.

The normal map perturbs the direction the surface appears to face at each pixel, giving the illusion of grooves, scratches and bumps without additional geometry; in Unity its texture must be marked as Normal map in the import settings so that it is decoded correctly. The occlusion map records how much ambient light can reach each point, darkening crevices and inner corners. Because it is meant to affect indirect light rather than direct sunlight, it belongs in its own map and not painted into the albedo.

Unity's Standard and Lit Shaders

In Unity's built-in render pipeline these principles are gathered in the Standard shader, which ships in two variants: Standard, which uses the metallic workflow, and Standard (Specular setup), which uses the specular one. The material inspector offers slots for albedo, metallic or specular, normal, height, occlusion, emission and detail maps. Smoothness is not a separate texture there; it is read from the alpha channel of either the metallic map or the albedo map, according to a choice in the inspector.

The Universal Render Pipeline provides the Lit shader, which plays the same role in a lighter rendering architecture. Its Workflow Mode chooses between Metallic and Specular, and its Smoothness source likewise points at the alpha of the metallic or specular map or at the albedo alpha. The High Definition Render Pipeline has its own, richer Lit shader. Across all of them the vocabulary is the same, and a set of textures authored correctly for one will translate to another with little more than repacking channels.

Packing is worth a word, because it often confuses newcomers. Texture memory is precious, and a greyscale map wastes three of the four channels in an image, so engines combine several greyscale properties into one texture. When an imported material looks strangely glossy or strangely dead, the cause is very often a smoothness map sitting in the wrong channel or a roughness map that was never inverted. Checking the channels is a cheap first step before blaming lights or shaders.

Discipline and Its Rewards

The rules of PBR feel restrictive at first, and artists sometimes resent them, since they forbid the quick fixes that used to make a material look right in a hurry. Yet the restriction is the point. A material that obeys energy conservation and carries an honest albedo can be dropped into a sunlit field, a cellar lit by a single lamp, or a scene at dusk, and in each it will look like the same substance, which is precisely what a real substance does.

Calibration helps keep the discipline. Real albedo values occupy a narrower range than the full span of a texture: very few natural materials are as dark as pure black or as bright as pure white, and textures that use those extremes tend to read as artificial. Many teams keep reference charts of measured values, and some photograph materials beside a known grey card. The aim is not exact physical fidelity, which few games need, but a common scale on which every asset agrees.

Torchlight on a wet timber gate, the dull gleam of an iron hinge, a muddy road under a cloudy sky: such surfaces, the stuff of a medieval settlement like the one in Crown & Ashes, are exactly the cases where PBR earns its keep, because each of them must hold together as the light changes around it. The artist decides what the surface is. The light, obeying its own old laws, decides how it looks.