---
id: "ray-traced-prism-displacement-mapping"
title: "Ray-Traced Prism Displacement Mapping"
aliases: [PDM, tessellation-free displacement ray tracing, prism displacement mapping, direct displacement ray tracing]
domain: "materials"
stage: "material"
realtime: "interactive"
platforms: [webgpu, desktop-gpu, cuda, cpu]
year_introduced: 2021
inputs: [mesh, heightfield, normals, uv-atlas]
outputs: [normals, depth]
style: "photoreal"
dynamic: "dynamic"
cost: "medium"
authority: "Thonat et al., 2021"
url: "https://texelatlas.vercel.app/t/ray-traced-prism-displacement-mapping/"
sources_verified_at: "2026-11-30"
---
# Ray-Traced Prism Displacement Mapping (Thonat et al., 2021)

> Ray-traces height-map displacement directly on coarse base triangles without tessellation by bounding each displaced triangle inside a curved-side triangular prism, intersecting its bilinear faces, and marching or subdividing against a min-max height hierarchy.

## Reach for it when

- parallax occlusion mapping breaks at curved edges and silhouettes
- need exact displaced micro-geometry without tessellating millions of triangles
- avoid self-intersection cracks when ray tracing heightmaps on meshes
- render sharp displaced brick or stone silhouettes in a path tracer
- intersect heightfield shells directly inside triangular prisms

## How it works

Traditional displacement mapping subdivides base meshes into millions of micro-triangles, blowing up BVH build time and GPU memory. **Ray-traced prism displacement mapping** keeps only the coarse base mesh in the acceleration structure (with AABBs inflated by the displacement bounds) and resolves fine relief lazily inside a custom ray-intersection routine.

Each base triangle `(pA, pB, pC)` is extruded along its smooth vertex normals `(nA, nB, nC)` between its minimum and maximum height offsets, forming a watertight **triangular prism** bounded by two flat endcap triangles and three **bilinear patch** side faces. When a ray enters a leaf prism's AABB, the intersector computes exact entry and exit distances `[tMin, tMax]` against the two cap triangles and three bilinear side patches (e.g. via Reshetov's closed-form ray-bilinear test). Because vertex normals are shared across adjacent base triangles, neighboring prisms meet seamlessly along identical bilinear surfaces.

Within `[tMin, tMax]`, the ray maps continuously into local barycentric `(u, v)` and height `h` coordinates inside the prism—forming a curved trajectory in texture space—and searches for the first crossing of the scalar height field using either hierarchical min-max mipmap / RMIP traversal or adaptive ray marching followed by secant/binary refinement, computing exact displaced shading normals via finite differences or micro-triangle reconstruction.

## When to use it

Choose it in GPU or CPU ray and path tracers when you need true displaced silhouettes, accurate self-shadowing, and crisp micro-geometry over large surfaces without pre-tessellating millions of triangles into a heavy BVH.

Prefer [parallax-occlusion-mapping](parallax-occlusion-mapping) or [relaxed-cone-step-mapping](relaxed-cone-step-mapping) in rasterized pipelines where only screen-space depth perturbation is needed. Prefer [normal-mapping-mikktspace](normal-mapping-mikktspace) when silhouettes do not need to change. Prefer [nanite-virtualized-geometry](nanite-virtualized-geometry) when rasterizing pre-authored high-poly triangle meshes.

## Cost

medium — Drastically cuts BVH memory and build cost compared to dense tessellation, trading it for per-ray prism intersection and height-hierarchy traversal inside displaced primitives.
Measured GPU Weight: 21.65× baseline (heavy) — 0.7122 ms median / 0.7445 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 17.07× baseline (moderate) — 0.2714 ms median (2.62× faster on L4).
Ampere A100 scaling: 12.86× baseline (moderate) — 0.3705 ms median (1.92× faster on A100).

## Failure modes

- Step-marching variants can miss thin spikes or ridges if the step size is too coarse relative to height-map frequency, whereas hierarchical min-max or RMIP bounds avoid missed intersections
- Strongly diverging vertex normals on concave creases can cause adjacent prisms to self-intersect or invert, producing cracks unless displacement scale is bounded by local curvature
- Grazing rays spend many traversal iterations inside long shallow prisms, increasing ray-tracing thread divergence on GPUs
- Requires watertight continuous vertex normals and consistent UV seams across base triangles to avoid gaps along UV chart boundaries

## Dataflow

- Inputs: mesh, heightfield, normals, uv-atlas
- Outputs: normals, depth
- Platforms: webgpu, desktop-gpu, cuda, cpu

## Presets

### Ray-Traced Prism Displacement — flat normal-mapped base shell (left) vs ray-traced prism micro-displacement (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_DISP_HEIGHT": 0.16,
  "P_PATTERN_FREQ": 6,
  "P_ROT_SPEED": 0.52,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_DISP_HEIGHT = 0.16; // P Prism Shell Height [0.04, 0.26, 0.01]
const float P_PATTERN_FREQ = 6.0; // P Brick Tile Freq [3.0, 10.0, 0.5]
const float P_ROT_SPEED = 0.52; // P Orbit Speed [0.0, 2.2, 0.05]
const float P_SPLIT = 0.48; // P NormalMap / PrismRT [0.0, 1.0, 0.02]

mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }

// Deep carved stone ashlar masonry heightfield h(u, v) in [0, 1]
float masonryHeight(vec2 uv, float freq) {
  vec2 g = uv * vec2(freq * 2.0, freq);
  float row = floor(g.y);
  g.x += mod(row, 2.0) * 0.5;
  vec2 f = fract(g);
  vec2 dEdge = min(f, 1.0 - f);
  float mortar = smoothstep(0.06, 0.14, min(dEdge.x, dEdge.y * 1.4));
  // Subtle chisel bevel & per-stone elevation variance
  float stoneVar = 0.78 + 0.22 * sin(row * 3.7 + floor(g.x) * 5.3);
  float relief = 0.08 * sin(uv.x * 24.0) * cos(uv.y * 24.0);
  return clamp(mortar * stoneVar + relief * mortar, 0.0, 1.0);
}

// Base coarse curved stone pillar cylinder (radius R0 = 0.50, height H = 1.45)
// Extruded prism shell spans [R0, R0 + dispH]
float mapDisplacedPillar(vec3 p, float dispH, float freq) {
  float r = length(p.xz);
  float ang = atan(p.z, p.x) / 6.2831853 + 0.5;
  float h = masonryHeight(vec2(ang * 2.0, p.y * 0.85 + 0.5), freq);
  float dCyl = r - (0.48 + h * dispH);
  float dCap = abs(p.y) - 0.74;
  return max(dCyl, dCap) * 0.65;
}

float mapBasePillar(vec3 p, float dispH) {
  float r = length(p.xz);
  return max(r - (0.48 + dispH * 0.5), abs(p.y) - 0.74);
}

vec3 calcDispNormal(vec3 p, float dispH, float freq) {
  vec2 e = vec2(0.0025, 0.0);
  return normalize(vec3(
    mapDisplacedPillar(p + e.xyy, dispH, freq) - mapDisplacedPillar(p - e.xyy, dispH, freq),
    mapDisplacedPillar(p + e.yxy, dispH, freq) - mapDisplacedPillar(p - e.yxy, dispH, freq),
    mapDisplacedPillar(p + e.yyx, dispH, freq) - mapDisplacedPillar(p - e.yyx, dispH, freq)
  ));
}

vec3 aces(vec3 x) {
  x = max(x, 0.0);
  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float screenX = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  bool isPrismRT = screenX >= split;
  float dispH = clamp(P_DISP_HEIGHT, 0.02, 0.30);
  float freq = clamp(P_PATTERN_FREQ, 2.5, 12.0);
  float spin = iTime * max(P_ROT_SPEED, 0.0) * 0.45;

  vec3 ro = vec3(0.0, 0.12, 2.25);
  vec3 rd = normalize(vec3(uv - vec2(0.0, 0.02), -1.52));
  ro.xz = rot2(spin) * ro.xz;
  rd.xz = rot2(spin) * rd.xz;

  vec3 col = mix(vec3(0.022, 0.028, 0.048), vec3(0.062, 0.078, 0.124), smoothstep(-0.55, 0.55, uv.y));
  vec3 lDir = normalize(vec3(0.68, 0.58, 0.48));

  float t = 0.0;
  bool hit = false;
  for (int i = 0; i < 64; i++) {
    vec3 p = ro + rd * t;
    float d = isPrismRT ? mapDisplacedPillar(p, dispH, freq) : mapBasePillar(p, dispH);
    if (d < 0.002) { hit = true; break; }
    t += d;
    if (t > 5.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * t;
    float ang = atan(p.z, p.x) / 6.2831853 + 0.5;
    vec2 mUV = vec2(ang * 2.0, p.y * 0.85 + 0.5);
    float hC = masonryHeight(mUV, freq);

    vec3 n;
    float shadow = 1.0;
    if (isPrismRT) {
      n = calcDispNormal(p, dispH, freq);
      // True ray-traced prism self-shadowing across deep mortar crevices!
      float ts = 0.02;
      for (int s = 0; s < 16; s++) {
        float ds = mapDisplacedPillar(p + lDir * ts, dispH, freq);
        if (ds < 0.002) { shadow = 0.22; break; }
        ts += max(ds, 0.015);
      }
    } else {
      // Left: flat silhouette cylinder with perturbed normal map only (no silhouette displacement, no self-occlusion!)
      vec3 baseN = normalize(vec3(p.x, 0.0, p.z));
      vec3 tang = normalize(vec3(-p.z, 0.0, p.x));
      vec3 bitang = vec3(0.0, 1.0, 0.0);
      float e = 0.004;
      float dU = (masonryHeight(mUV + vec2(e, 0.0), freq) - hC) / e;
      float dV = (masonryHeight(mUV + vec2(0.0, e), freq) - hC) / e;
      n = normalize(baseN - (tang * dU + bitang * dV) * dispH * 0.45);
    }

    float diff = max(dot(n, lDir), 0.0) * shadow;
    float spec = pow(max(dot(n, normalize(lDir - rd)), 0.0), 28.0) * shadow;
    vec3 stone = mix(vec3(0.24, 0.22, 0.20), vec3(0.76, 0.68, 0.58), smoothstep(0.15, 0.85, hC));
    col = stone * (0.20 + 0.92 * diff) + vec3(1.0, 0.95, 0.88) * spec * 0.28;
    // Highlight crisp displaced silhouette boundary on right
    float rim = pow(1.0 - max(dot(n, -rd), 0.0), 3.2);
    col += (isPrismRT ? vec3(0.24, 0.82, 0.98) : vec3(0.92, 0.34, 0.26)) * rim * 0.28;
  }

  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
  col = mix(col, vec3(0.95, 0.97, 1.0), sep);

  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Lineage

- extends [Parallax occlusion mapping](https://texelatlas.vercel.app/t/parallax-occlusion-mapping.md)

## Combines with

- [Unidirectional Path Tracing](https://texelatlas.vercel.app/t/path-tracing.md): Provides true displaced silhouettes and self-shadowing inside a path tracer without exploding scene triangle counts.
- [SAH BVH construction](https://texelatlas.vercel.app/t/sah-bvh-construction.md): Stores each base triangle's inflated prism AABB as a custom primitive inside a standard BVH.

## Sources

1. [primary] Theo Thonat, Francois Beaune, Xin Sun, Nathan Carr, Tamy Boubekeur (2021) Tessellation-free displacement mapping for ray tracing. ACM Transactions on Graphics. https://doi.org/10.1145/3478513.3480535 (verified via crossref on 2026-11-30)
2. [primary] Theo Thonat, Iliyan Georgiev, François Beaune, Tamy Boubekeur (2023) RMIP: Displacement ray tracing via inversion and oblong bounding. SIGGRAPH Asia 2023 Conference Papers. https://doi.org/10.1145/3610548.3618182 (verified via doi.org on 2026-11-30)
3. [secondary] Brian Smits, Peter Shirley, Michael M. Stark (2000) Direct Ray Tracing of Displacement Mapped Triangles. Eurographics. https://doi.org/10.1007/978-3-7091-6303-0_28 (verified via crossref on 2026-11-30)
4. [secondary] Serban D. Porumbescu, Brian Budge, Louis Feng, Kenneth I. Joy (2005) Shell maps. ACM Transactions on Graphics. https://doi.org/10.1145/1073204.1073239 (verified via crossref on 2026-11-30)
5. [secondary] Alexander Reshetov (2019) Cool Patches: A Geometric Approach to Ray/Bilinear Patch Intersections. Ray Tracing Gems. https://doi.org/10.1007/978-1-4842-4427-2_8 (verified via crossref on 2026-11-30)
6. [implementation] pissang (2026) pissang/mutracer. https://github.com/pissang/mutracer License: MIT. (verified via github on 2026-11-30)

## Cite this entry

Texel. "Ray-Traced Prism Displacement Mapping." https://texelatlas.vercel.app/t/ray-traced-prism-displacement-mapping/ (accessed 2026-12-01).
