TA Toolbox Home / TA Glossary

Parallax Mapping

2026-08-27

What is Parallax Mapping

Parallax mapping is an advanced texture mapping technique used to simulate bumpy, three-dimensional surfaces on flat polygons. It offsets texture coordinates based on the viewing angle and a surface height map, creating a parallax displacement that gives a stronger sense of depth than normal mapping. Unlike normal mapping, which only alters the lighting normal, parallax mapping actually changes the texture sampling position, so raised areas can occlude recessed areas as the view angle changes, producing an effect closer to real geometry.

Basic Principle

The core idea of parallax mapping is based on simple geometric relationships. When viewing a surface with height from an angle, a point in texture space is shifted due to the height. Suppose the surface has a height field h(u,v), and the view direction is V. The actual visible point should be offset from the original position by projecting along V onto the surface. For simplification, an approximation is often used: based on the height h and the tangent-plane component of the view direction, the texture coordinates are shifted toward the view direction by an amount. The formula is:

`offset = h * V.xy / V.z`

This approximation works well for gradual height changes but can cause distortion for steep heights or very oblique viewing angles.

Common Types and Variants

Basic Parallax Mapping

The simplest form, using the above formula for a single offset. Easy to implement and low performance cost, but may exhibit visible sliding and distortion at steep angles.

Parallax Mapping with Offset Limiting

To reduce distortion, a scaling factor is applied to the offset, often related to the angle of the view direction in the tangent plane. This prevents excessive texture coordinate offsets and sampling errors, but weakens the effect.

Steep Parallax Mapping

Divides the height field into multiple layers and samples the height map incrementally along the view direction to find the first occluded layer, obtaining a more accurate offset. More layers produce better results but higher performance cost.

Relief Parallax Mapping

Refines steep parallax mapping by interpolating between found layers for sub-pixel accuracy. Effect approaches true displacement mapping but with higher computational cost.

Parallax Occlusion Mapping (POM)

An improved steep parallax mapping that uses linear interpolation or binary search to precisely determine the intersection of the view ray with the height field, producing self-shadowing and more accurate silhouettes. POM is widely used in modern games.

Comparison with Normal Mapping and Displacement Mapping

  • **Normal Mapping**: Changes the normal used in lighting calculations but does not alter texture coordinates, so the geometric surface remains flat with no parallax displacement.
  • **Parallax Mapping**: Changes texture sampling coordinates, making the texture appear to have depth, but does not alter the geometric surface; lighting is still based on the original normal (unless combined with normal mapping).
  • **Displacement Mapping**: Actually changes vertex positions of the geometry, producing real bumps, requires sufficient vertex density, highest performance cost.

Parallax mapping is typically implemented in the fragment shader, requires a height map, and is often combined with normal mapping for best results.

Advantages and Limitations

**Advantages**:

  • Compared to displacement mapping, no extra geometry needed, lower performance cost.
  • Produces more realistic depth and parallax effects than normal mapping.
  • Suitable for details like brick walls, cobblestones, carved surfaces.

**Limitations**:

  • Still an approximation, can produce distortion or artifacts at extreme viewing angles.
  • Surface silhouette edges remain flat, cannot produce true contour changes.
  • Requires an additional height map, increasing texture memory and sampling count.
  • For complex geometry, computation can be heavy, especially for advanced variants like POM.

Application Scenarios

Parallax mapping is commonly used in games and real-time rendering for materials requiring detailed bumps, such as:

  • Building walls, bricks, stone pathways
  • Sci-fi surfaces, mechanical panels
  • Terrain details (e.g., rocks, gravel)
  • Any flat material needing enhanced depth perception

In implementation, height information is often stored in the alpha channel of the normal map or in a separate height map. Modern game engines (e.g., Unity, Unreal) have built-in support for parallax mapping or POM.

FAQ

What is the difference between parallax mapping and normal mapping?

Normal mapping only changes the normal direction for lighting calculations, not the texture sampling position, so there is no parallax displacement. Parallax mapping offsets texture coordinates based on viewing angle, simulating occlusion effects from height differences, resulting in stronger visual depth.

What additional texture is needed for parallax mapping?

A height map (Height Map) is required, typically a grayscale texture representing surface height. The height map can be stored separately or packed into the alpha channel of the normal map.

What are common types of parallax mapping?

Common types include basic parallax mapping, parallax mapping with offset limiting, steep parallax mapping, relief parallax mapping, and parallax occlusion mapping (POM). They differ in effect and performance.

What are the applications of parallax mapping in games?

Widely used for brick walls, cobblestone paths, sci-fi panels, terrain details, etc., to add depth to flat models and enhance visual quality.

What is the performance cost of parallax mapping?

Basic parallax mapping has low performance cost, but advanced variants like POM require multiple texture samples and loop calculations, resulting in higher cost. A balance between effect and performance is needed in practice.