Introduction

Open any modern video game and the characters look richly detailed — rough skin pores, dented metal, carved stone — yet your GPU is drawing flat triangles. The secret is normal mapping: a technique that stores, for every pixel on a surface, the direction it is pretending to face, and hands that direction to the lighting equation instead of the true flat-polygon normal.

The result is striking. A wall that is literally two triangles can absorb and reflect light as though it were covered in thousands of tiny bumps. Artists sculpt an extremely detailed model, bake the surface normals of that detail into a texture, and then apply the texture to the low-polygon version that ships in the game.

To understand why this works, you need to understand what a surface normal is and how light uses it.

Try It: Move the Light

The quad below is geometrically flat — four corners, two triangles. But its pixels carry a normal map that encodes the orientation of an imaginary bumpy surface. Move the light (click or drag) and watch the apparent bumps catch and lose the light just like real geometry would.

<!-- {{c_layout_comment}} -->
<div class="controls">
  <label class="toggle">
    <input type="checkbox" id="flatToggle">
    <span>{{label_flat}}</span>
  </label>
  <span class="hint-text">{{hint_drag}}</span>
</div>
<canvas id="c" width="380" height="280" title="{{canvas_title}}"></canvas>
<p class="caption" id="caption">{{caption_normal}}</p>
/* {{c_style_comment}} */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: #1a1a2e; display: flex;
       flex-direction: column; align-items: center; padding: 1rem; gap: .6rem; }
.controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
label.toggle { display: flex; align-items: center; gap: .4rem; color: #ccd6f6;
               font-size: .9rem; cursor: pointer; user-select: none; }
input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.hint-text { color: #8892b0; font-size: .82rem; }
canvas { border-radius: 8px; cursor: crosshair; touch-action: none; }
.caption { color: #8892b0; font-size: .8rem; text-align: center; min-height: 1.2em; }
// Code not found

Toggle Flat shading to see the same quad with only the polygon's true normal — every pixel shaded identically — then switch back to Normal map to feel the difference. The geometry never changed: only the direction each pixel claims to face.

The Math Behind It

A surface normal is a unit vector n^\hat{n} perpendicular to the surface at a given point. The standard diffuse lighting model (Lambertian) computes brightness as:

L=max(0,  n^l^)L = \max(0,\; \hat{n} \cdot \hat{l})

where l^\hat{l} is the unit vector toward the light. When n^\hat{n} points straight at the light the surface is brightest; when n^\hat{n} is perpendicular to l^\hat{l} the surface is dark. Normal mapping works by substituting a per-pixel n^\hat{n} read from a texture.

Encoding normals in RGB. A unit vector has components in [1,1][-1, 1]. Colors live in [0,1][0, 1]. The mapping is:

texel=n^+12\text{texel} = \frac{\hat{n} + 1}{2}

That is why normal maps are predominantly blue-purple: a surface mostly facing straight up encodes as (0.5,0.5,1.0)(0.5,\, 0.5,\, 1.0), which maps to a lilac-blue color.

Tangent space. A normal map stores vectors relative to the local surface, not the world. This "tangent space" is defined by three vectors at each vertex: the face normal N^\hat{N}, a tangent T^\hat{T} (along the U texture axis), and a bitangent B^\hat{B} (along V). At runtime the GPU transforms the stored tangent-space normal into world space using the matrix [T^  B^  N^][\hat{T}\; \hat{B}\; \hat{N}], then feeds it to the lighting equation. The upside: the same normal-map texture works on any orientation of the surface.

Normal mapping is a pure lighting trick with zero extra geometry. Its cost is one extra texture lookup per fragment — a tiny price for the visual richness it delivers.

Where It Matters

Normal mapping is one of the most widely deployed techniques in real-time graphics because it is cheap, effective, and fits naturally into the modern rendering pipeline:

  • Video games: every AAA title uses normal maps for characters, environments and props. A high-resolution sculpt baked into a normal map can represent millions of virtual polygons on a mesh of a few thousand.
  • Physically based rendering (PBR): modern PBR pipelines extend normal mapping with roughness and metalness maps. The three together define how a surface interacts with light at every pixel.
  • Film and VFX: even in offline rendering, normal maps accelerate the shading of assets without the overhead of subdivision surfaces everywhere.
  • Product visualization and AR: furniture, shoes, and electronics shown in configurators or augmented reality use normal maps to give materials a realistic tactile feel without expensive scans or meshes.
  • Terrain and architecture: large-scale surfaces like ground or concrete walls use normal maps (often combined with heightmaps) to break up the flat appearance that would otherwise expose the polygon grid.

The technique is not without limits — silhouettes still reveal the true flat edges, and extreme viewing angles break the illusion. Variants like parallax mapping and relief mapping push the illusion further by also shifting texture coordinates to simulate depth.

Conclusion

Normal mapping is a beautiful lie: you hand the lighting equation a direction that the surface does not actually have, and the light cooperates so convincingly that the illusion holds up in motion, under moving lights, from almost any angle. The geometry stays cheap; the apparent detail stays rich.

The trick works because light does not care about geometry — it only cares about the direction it is being told the surface faces. Change that direction per pixel, store it in an image, and you get a free sculpture out of two triangles.

That same principle — encoding direction rather than position — underlies many computer graphics ideas beyond normal maps. Once you see the pattern, the surfaces around you in games and films look very different.

Share this article

Pick a channel — or use your device's native share sheet.

Comments

Loading comments...

https://www.kipuhub.com/en/article/normal-mapping/Content licensed under CC BY-NC 4.0.