---
id: "progressive-photon-mapping"
title: "Progressive Photon Mapping"
aliases: [PPM, SPPM]
domain: "gi"
stage: "lighting"
realtime: "interactive"
platforms: [cpu, cuda, desktop-gpu]
year_introduced: 2008
inputs: [mesh, material-params]
outputs: [radiance]
style: "photoreal"
dynamic: "static"
cost: "offline"
authority: "Hachisuka et al., 2008"
url: "https://texelatlas.vercel.app/t/progressive-photon-mapping/"
sources_verified_at: "2026-11-29"
---
# Progressive Photon Mapping (Hachisuka et al., 2008)

> Photon mapping reformulated so the gather radius shrinks over iterations. The result converges to the exact answer with bounded memory and handles extreme specular light transport.

## Reach for it when

- caustics from glass or water stay noisy
- lamp inside glass renders almost black
- photon map eats memory and still looks blotchy
- light through a pool surface needs long specular paths
- want a render that keeps refining without bias

## How it works

Classic photon mapping needs infinite memory to converge. Progressive photon mapping inverts the order. First, rays from the camera find **visible points** (diffuse hits seen after any specular chain) and store them with a small initial radius. Then, in repeated passes, a fresh batch of photons is traced and discarded; each photon that lands within a visible point's radius adds its flux to that point's running total.

After every pass the radius of each visible point shrinks and its accumulated flux is rescaled by a fixed ratio governed by a parameter `alpha`, chosen so that variance falls while bias also falls. In the limit both vanish, so the estimate is consistent: unlimited photons effectively contribute, but only one batch exists in memory.

**Stochastic PPM** extends this so that each pass also redraws the camera ray, which lets distributed effects like depth of field, motion blur and glossy surfaces work. Lookup uses a grid or hash over visible points rather than a tree of photons.

## When to use it

Choose it for caustics and scenes with long specular chains (lamp inside glass, light through a pool surface) when you want an image that keeps refining without running out of memory.

Prefer [vertex-connection-and-merging](vertex-connection-and-merging) when the scene also has plenty of non-specular paths where connections beat merging. Prefer [path-tracing](path-tracing) or [bidirectional-path-tracing](bidirectional-path-tracing) when you must stay unbiased. Prefer [photon-mapping](photon-mapping) when a one-shot photon map is acceptable and you only need a quick preview.

## Cost

offline — One light-tracing pass per iteration plus a grid lookup per photon hit; memory is proportional to the number of visible points (pixels), not photons.
Measured GPU Weight: 7.94× baseline (moderate) — 0.2611 ms median / 0.2697 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 6.52× baseline (moderate) — 0.1037 ms median (2.52× faster on L4).
Ampere A100 scaling: 5.34× baseline (light) — 0.1539 ms median (1.7× faster on A100).

## Failure modes

- Early iterations show large blur and low-frequency bias that fades slowly as the radius shrinks
- The radius reduction rate trades noise against bias; a bad `alpha` leaves visible blur or persistent noise
- Visible points are fixed per iteration, so view changes restart the render
- Hash/grid lookup performance degrades when radii vary widely across the image

## Dataflow

- Inputs: mesh, material-params
- Outputs: radiance
- Platforms: cpu, cuda, desktop-gpu

## Presets

### Progressive Photon Mapping (PPM) — wide initial gather radius (left) vs shrinking caustic radius convergence (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_PPM_PASSES": 0.85,
  "P_CAUSTIC_INT": 1.25,
  "P_RING_SPIN": 0.55,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_PPM_PASSES = 0.85; // P PPM Pass Progress [0.05, 1.0, 0.02]
const float P_CAUSTIC_INT = 1.25; // P Caustic Energy [0.3, 2.2, 0.05]
const float P_RING_SPIN = 0.55; // P Light Spin [0.0, 2.2, 0.05]
const float P_SPLIT = 0.48; // P Wide R / Shrunk R [0.0, 1.0, 0.02]

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

// Analytical gold wedding-ring cardioid caustic intensity (classic Henrik Wann Jensen PPM showcase!)
// Sharp cusp cardioid focused inside the ring on the tabletop, convolved by photon gather radius R_i
float evalCardioidCaustic(vec2 xz, float gatherR) {
  // Parametric gold ring of radius 0.62 centered at origin, light coming from +X
  float energy = 0.0;
  // Accumulate 28 photon-hit clusters along the reflective inner ring cardioid cusp
  for (int i = 0; i < 28; i++) {
    float th = (float(i) / 27.0 - 0.5) * 2.55;
    // Exact cardioid caustic curve of a circular mirror under parallel light:
    // x = (R/4)*(3*cos(th) - cos(3*th)), z = (R/4)*(3*sin(th) - sin(3*th))
    vec2 cPos = vec2(
      0.165 * (3.0 * cos(th) - cos(3.0 * th)) - 0.14,
      0.165 * (3.0 * sin(th) - sin(3.0 * th))
    );
    float d2 = dot(xz - cPos, xz - cPos);
    float r2 = max(gatherR * gatherR, 0.0005);
    // Normalized Epanechnikov/Gaussian photon density kernel K(d / R_i) / R_i^2
    energy += exp(-d2 / r2) / (0.14 + gatherR * 12.0);
  }
  return energy * 0.24;
}

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 isConverged = screenX >= split;
  float prog = clamp(P_PPM_PASSES, 0.05, 1.0);
  float cGain = clamp(P_CAUSTIC_INT, 0.2, 2.4);
  float spin = iTime * max(P_RING_SPIN, 0.0) * 0.42;

  vec3 ro = vec3(0.0, 1.35, 1.85);
  vec3 rd = normalize(vec3(uv.x, uv.y - 0.46, -1.35));
  vec3 bg = mix(vec3(0.022, 0.026, 0.042), vec3(0.062, 0.074, 0.112), smoothstep(-0.5, 0.5, uv.y));
  vec3 col = bg;

  // Raymarch the polished gold ring (hollow cylinder wall at radius 0.62, height 0.24 resting on table y=0)
  float tRing = 1e5;
  float t = 0.2;
  for (int i = 0; i < 52; i++) {
    vec3 p = ro + rd * t;
    float r = length(p.xz);
    float dWall = abs(r - 0.62) - 0.042;
    float dY = abs(p.y - 0.14) - 0.14;
    float d = max(dWall, dY);
    if (d < 0.0025) { tRing = t; break; }
    t += max(d * 0.85, 0.006);
    if (t > 6.0) break;
  }

  float tTable = (rd.y < -0.01) ? (-ro.y / rd.y) : 1e5;
  if (tTable < 0.05 || tTable > 10.0) tTable = 1e5;

  vec3 lDir = normalize(vec3(cos(spin), 0.52, sin(spin)));

  if (tRing < tTable && tRing < 1e4) {
    vec3 p = ro + rd * tRing;
    vec3 n;
    if (abs(p.y - 0.28) < 0.01) n = vec3(0.0, 1.0, 0.0);
    else n = normalize(vec3(p.x, 0.0, p.z)) * ((length(p.xz) > 0.62) ? 1.0 : -1.0);
    vec3 refl = reflect(rd, n);
    float spec = pow(max(dot(n, normalize(lDir - rd)), 0.0), 64.0);
    float rim = pow(1.0 - max(dot(n, -rd), 0.0), 3.0);
    vec3 gold = vec3(0.98, 0.78, 0.34);
    col = gold * (0.28 + 0.65 * max(dot(n, lDir), 0.0) + 0.35 * smoothstep(-0.3, 0.6, refl.y))
        + vec3(1.0, 0.96, 0.86) * spec * 1.45 + gold * rim * 0.35;
  } else if (tTable < 1e4) {
    vec3 p = ro + rd * tTable;
    vec2 rotXZ = rot2(-spin) * p.xz;

    // Fine grained warm walnut studio tabletop
    float grain = 0.5 + 0.5 * sin(p.x * 26.0 + sin(p.z * 8.0) * 1.8);
    vec3 wood = mix(vec3(0.16, 0.12, 0.09), vec3(0.28, 0.21, 0.16), grain);
    // Soft shadow cast by gold ring onto table
    float rDist = abs(length(p.xz - lDir.xz * 0.22) - 0.62);
    float ringSh = smoothstep(0.04, 0.14, rDist);

    // PPM progressive radius shrinking: R_{i+1} = R_i * sqrt((N + alpha*M)/(N + M))
    // Left: early pass 1 with wide biased gather radius R_0 (blurry caustic!)
    // Right: converged pass N with tight shrinking radius R_N (razor-sharp cusp caustic!)
    float gatherR = isConverged ? mix(0.12, 0.026, prog) : 0.16;
    float caustic = evalCardioidCaustic(rotXZ, gatherR) * cGain;

    // Subtle spectral gold-amber tint along caustic intensity
    vec3 causticCol = mix(vec3(0.98, 0.66, 0.20), vec3(1.0, 0.96, 0.80), clamp(caustic * 0.55, 0.0, 1.0));
    col = wood * (0.25 + 0.75 * ringSh) + causticCol * caustic * 1.35;

    // Show sample gather-radius diagnostic circle on tabletop for visual clarity!
    vec2 probe = p.xz - vec2(isConverged ? 0.22 : -0.22, 0.16);
    float probeRing = exp(-abs(length(probe) - gatherR) * 110.0);
    col += (isConverged ? vec3(0.22, 0.96, 0.86) : vec3(0.98, 0.36, 0.28)) * probeRing * 0.75;

    col = mix(col, bg, 1.0 - exp(-tTable * 0.12));
  }

  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 [Photon Mapping](https://texelatlas.vercel.app/t/photon-mapping.md)

## Combines with

- [Vertex Connection and Merging](https://texelatlas.vercel.app/t/vertex-connection-and-merging.md): VCM reuses this radius-reduction schedule for its merging half.

## Sources

1. [primary] Toshiya Hachisuka, Shinji Ogaki, Henrik Wann Jensen (2008) Progressive photon mapping. ACM Transactions on Graphics. https://doi.org/10.1145/1409060.1409083 (verified via crossref on 2026-11-29)
2. [tutorial] Matt Pharr, Wenzel Jakob, Greg Humphreys Stochastic Progressive Photon Mapping (Physically Based Rendering, 3rd edition). pbr-book.org. https://pbr-book.org/3ed-2018/Light_Transport_III_Bidirectional_Methods/Stochastic_Progressive_Photon_Mapping (verified via http on 2026-11-29)
3. [implementation] mmp (2015) mmp/pbrt-v3. https://github.com/mmp/pbrt-v3 License: BSD-2-Clause. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Progressive Photon Mapping." https://texelatlas.vercel.app/t/progressive-photon-mapping/ (accessed 2026-12-01).
