Skip to content
CoreSource checked

Normal Mapping

Adds lighting detail by perturbing shading normals from a texture instead of changing geometry.

Quick Facts

Compact metadata for implementation and discovery.

Category
Rendering
Difficulty
Intermediate
Family
Surface Shading
Tier
Core
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
3
Code example
Ready
Visualization
Ready

Overview

Normal mapping reads a normal vector from a texture, transforms it from tangent space to the surface's shading space, and uses it for lighting calculations.

Core Concepts

tangent spacenormal perturbationtexture lookupsurface lighting

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(1)

Average

O(pixels)

Worst

O(pixels)

Space

O(texture size)

When to Use

  • Use when fine surface detail should affect lighting without adding mesh triangles.
  • Use when tangent, bitangent, and normal data can be generated consistently.

When Not to Use

  • Avoid when the silhouette must change; normal maps do not alter geometry.
  • Avoid when tangent-space conventions differ between asset baking and rendering.

What It Does

  • Perturbs surface normals from a texture to add lighting detail without extra geometry
  • Uses tangent space and normal perturbation to guide the work.
  • Produces rendered image.

Use Cases

  • Real-time graphics
  • Offline rendering
  • Lighting and visibility effects

Inputs

  • Scene geometry
  • Materials
  • Camera and lighting state

Outputs

  • Rendered image
  • Visibility or shading buffers

Key Formulas (1)

Normal transform

nworld = normalize(TBN · ntangent)
n_world = normalize(TBN * n_tangent)

Moves a sampled tangent-space normal into world or view space.

Pseudocode

  1. 1.Sample the normal-map texel
  2. 2.Decode it into a tangent-space normal
  3. 3.Build or read the tangent-to-world basis
  4. 4.Transform and normalize the normal
  5. 5.Use the transformed normal in the lighting equation

Canonical Example

Input
flat quad with a brick normal map and one light
Output
brick grooves appear in lighting while the quad silhouette remains flat
Explanation
The normal texture changes the lighting direction at each fragment, not the mesh shape.

Implementation Notes

  • Decode texture values from [0, 1] to [-1, 1].
  • Transform the decoded normal with a consistent tangent basis.
  • Renormalize the shading normal before evaluating lighting.

Common Pitfalls

  • Green-channel orientation and tangent handedness mismatches can invert detail.
  • Normal maps should not be sampled as gamma-corrected color data.
  • Missing or inconsistent tangents create seams and lighting artifacts.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show rays, samples, buffers, or shading terms that contribute to the final pixel.

Normal Mapping mechanism walkthrough step 1 of 5
Step 1 of 5: Sample the normal-map texel
rendering-mechanism

Notes

Normal mapping affects shading only; displacement or tessellation is needed for actual geometric relief.

Sources (1)

What each reference supports for this entry.

Cohen, Olano, and Manocha 1998

Paper

Appearance-preserving simplification paper using normal maps to preserve surface detail.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Conceptual neighborParallax Occlusion Mapping

Both add apparent surface detail without changing base geometry.

Often paired withPhong Shading

Normal maps modify shading normals used by local lighting models.

Tags

GraphicsShadingTexture MappingLighting