Parallax Occlusion Mapping in Game Development

Parallax Occlusion Mapping (POM) is an advanced shading technique used by game artists to simulate complex geometric depth on flat, low-poly surfaces without adding actual polygons. By using a height map and raymarching algorithms within the pixel shader, POM shifts texture coordinates based on the player’s viewing angle to create a convincing illusion of 3D detail. This article explores how POM works, the workflow artists use to implement it, its visual benefits, and the best practices for maintaining optimal game performance.

How Parallax Occlusion Mapping Works

Unlike traditional bump or normal mapping, which only alters how light interacts with a flat surface, Parallax Occlusion Mapping alters the perceived structure of the surface itself.

  1. Height Map Sampling: The shader reads a grayscale height map (or displacement map), where white represents peaks and black represents valleys.
  2. Raymarching: When a camera views the surface, the shader casts a virtual ray from the view direction into the height map.
  3. Intersection Calculation: The algorithm steps along the ray to determine where it intersects with the virtual 3D surface defined by the height data.
  4. UV Offset: Once the intersection point is found, the shader offsets the texture coordinates (UVs), displaying the texture details that would realistically be visible from that specific viewing angle.

This process causes foreground elements (like the tops of cobblestones) to realistically occlude background elements (like the mortar between them) as the camera moves.

The Artist Workflow for POM

Game artists integrate POM into their production pipeline using specialized texturing and engine tools:

  • Height Map Generation: Artists author high-precision 16-bit grayscale height maps using tools like Substance 3D Designer, ZBrush, or photogrammetry software. Smooth gradients and accurate depth scaling prevent stepping artifacts.
  • Material Setup: In engines like Unreal Engine or Unity, the height map is plugged into a POM shader node alongside standard Albedo, Normal, and Roughness maps.
  • Parameter Tuning: Artists adjust key properties within the shader:
    • Height Ratio (Depth Scale): Controls how deep the displacement appears.
    • Min/Max Samples: Sets the minimum and maximum ray steps. Surfaces viewed at grazing angles require more steps to avoid visual slicing.
    • Reference Plane: Defines whether the height pushes inward from the mesh surface or extrudes outward.

Key Visual and Technical Benefits

  • Zero Additional Geometry: Complex surfaces like brick walls, rocky terrain, tree bark, and tiled roofs look fully three-dimensional while maintaining simple, flat geometry.
  • Self-Shadowing: Advanced POM shaders cast internal shadows within the crevices of the texture by tracing an additional ray toward the primary light source, adding dramatic depth.
  • Cost Efficiency Compared to Tessellation: POM replaces expensive geometric subdivision and vertex displacement with pixel-level math, drastically reducing memory bandwidth and draw-call overhead.

Performance Optimization and Best Practices

While POM is far cheaper than rendering millions of extra polygons, excessive raymarching can strain the GPU. Artists apply several optimization techniques to keep frame rates stable:

  • Adaptive Sampling: Shaders use lower sample counts when the camera is perpendicular to the surface and increase samples only at steep viewing angles.
  • Distance-Based Level of Detail (LOD): POM is computationally wasted at long distances. Shaders fade POM out into standard normal mapping as the player moves away.
  • Texture Channel Packing: Artists pack the grayscale height map into the alpha channel of a normal or roughness map to reduce texture samplers and memory overhead.
  • Targeted Application: POM is best reserved for hero assets, structural environment art, and surfaces viewed closely by the player, rather than applied universally across all scene materials.