{
 "id": "metropolis-light-transport",
 "title": "Metropolis Light Transport",
 "aliases": [
  "MLT",
  "PSSMLT"
 ],
 "domain": "gi",
 "subdomain": "Monte Carlo light transport",
 "stage": "lighting",
 "realtime": "offline",
 "platforms": [
  "cpu",
  "cuda"
 ],
 "year_introduced": 1997,
 "inputs": [
  "mesh",
  "material-params"
 ],
 "outputs": [
  "radiance"
 ],
 "style": "photoreal",
 "dynamic": "static",
 "summary": "Samples light paths with a Markov chain that mutates the current path, spending effort proportional to path contribution. Strong on difficult, narrow-light-path scenes and weak on simple ones.",
 "how_it_works": "Instead of generating independent random paths, MLT keeps a current **valid path** from the light to the eye and proposes a small mutation of it. The proposal is accepted with a probability based on the ratio of path contributions, which is the Metropolis-Hastings rule. The resulting chain visits paths with density proportional to their image contribution, so once the chain finds a hard-to-discover bright path (light through a keyhole, a caustic) it stays nearby and explores variations.\n\nThe original formulation mutates paths directly with bidirectional mutations, lens and caustic perturbations and so on, each needing its own transition density. A later and far simpler variant, **primary-sample-space MLT**, mutates the vector of random numbers feeding an ordinary path tracer or BDPT, so any existing integrator becomes a Markov chain sampler.\n\nOutput is the histogram of visited pixels, normalized with a separate estimate of total image brightness; mutation strategies and a small amount of independent sampling start the chain.",
 "when_to_use": "Choose it for scenes where valid light paths occupy a tiny part of path space: lit only through a slightly open door, a lamp inside nested glass, a pool caustic.\n\nPrefer [bidirectional-path-tracing](bidirectional-path-tracing) or [vertex-connection-and-merging](vertex-connection-and-merging) when you want predictable convergence and easy parallelism. Prefer [path-tracing](path-tracing) for ordinary scenes: MLT's correlated samples give blotchy, non-uniform noise across the image and complicate animation. Prefer [path-guiding](path-guiding) when you want an adaptive sampler without Markov-chain correlation.",
 "cost": {
  "class": "offline",
  "notes": "Per-sample cost is similar to the underlying integrator; the benefit is variance in hard scenes. Normalization and start-up estimation add overhead."
 },
 "failure_modes": [
  "Correlated samples give splotchy, non-uniform noise and temporal flicker in animation",
  "The chain can get stuck in an isolated mode and miss other bright path families",
  "Per-pixel convergence is uneven, so easy regions can end up noisier than with plain path tracing",
  "Hard to parallelize across a GPU without independent chains and a careful normalization pass"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/258734.258775",
   "type": "paper",
   "title": "Metropolis light transport",
   "authors": [
    "Eric Veach",
    "Leonidas J. Guibas"
   ],
   "year": 1997,
   "venue": "Proceedings of the 24th annual conference on Computer graphics and interactive techniques  - SIGGRAPH '97",
   "url": "https://doi.org/10.1145/258734.258775",
   "ids": {
    "doi": "10.1145/258734.258775"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/258734.258775",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/258734.258775",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/258734.258775",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/258734.258775",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/258734.258775",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "veach1997metropolis"
  },
  {
   "role": "tutorial",
   "key": "url:https://pbr-book.org/3ed-2018/Light_Transport_III_Bidirectional_Methods/Metropolis_Light_Transport",
   "type": "tutorial",
   "title": "Metropolis Light Transport (Physically Based Rendering, 3rd edition)",
   "authors": [
    "Matt Pharr",
    "Wenzel Jakob",
    "Greg Humphreys"
   ],
   "year": null,
   "venue": "pbr-book.org",
   "url": "https://pbr-book.org/3ed-2018/Light_Transport_III_Bidirectional_Methods/Metropolis_Light_Transport",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261011115840/https://www.pbr-book.org/3ed-2018/Light_Transport_III_Bidirectional_Methods/Metropolis_Light_Transport",
     "timestamp": "20261011115840"
    },
    "page_title": "Metropolis Light Transport",
    "host": "pbr-book.org",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://pbr-book.org/3ed-2018/Light_Transport_III_Bidirectional_Methods/Metropolis_Light_Transport → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://pbr-book.org/3ed-2018/Light_Transport_III_Bidirectional_Methods/Metropolis_Light_Transport → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://pbr-book.org/3ed-2018/Light_Transport_III_Bidirectional_Methods/Metropolis_Light_Transport → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0.95,
   "__bib": "pharrmetropolis"
  },
  {
   "role": "implementation",
   "key": "gh:mmp/pbrt-v3",
   "type": "code",
   "title": "mmp/pbrt-v3",
   "description": "Source code for pbrt, the renderer described in the third edition of \"Physically Based Rendering: From Theory To Implementation\", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.",
   "authors": [
    "mmp"
   ],
   "year": 2015,
   "venue": "GitHub",
   "url": "https://github.com/mmp/pbrt-v3",
   "ids": {
    "repo": "mmp/pbrt-v3"
   },
   "license": "BSD-2-Clause",
   "extra": {
    "stars": 5094,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2023-09-03T11:38:00Z",
    "language": "C++",
    "homepage": "http://pbrt.org",
    "license_name": "BSD 2-Clause \"Simplified\" License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mmp/pbrt-v3",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mmp/pbrt-v3",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mmp/pbrt-v3",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mmp/pbrt-v3",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mmp/pbrt-v3",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mmp/pbrt-v3",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "mmp2015pbrt"
  }
 ],
 "presets": [
  {
   "id": "metropolis-light-transport-live",
   "title": "Metropolis Light Transport (MLT) — uniform PT missed keyhole (left) vs MCMC Markov-chain exploration (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_DOOR_GAP": 0.24,
    "P_MCMC_GAIN": 1.15,
    "P_CHAIN_ANIM": 0.85,
    "P_SPLIT": 0.48
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_DOOR_GAP = 0.24; // P Door Slit Width [0.08, 0.45, 0.02]\nconst float P_MCMC_GAIN = 1.15; // P MCMC Convergence [0.3, 1.6, 0.05]\nconst float P_CHAIN_ANIM = 0.85; // P Mutation Rate [0.0, 2.2, 0.05]\nconst float P_SPLIT = 0.48; // P PT / MLT Split [0.0, 1.0, 0.02]\n\nfloat hash21(vec2 p) {\n  p = fract(p * vec2(127.1, 311.7));\n  p += dot(p, p + 34.5);\n  return fract(p.x * p.y);\n}\n\n// Famous Veach \"Door Ajar\" difficult light-transport benchmark:\n// Bright room behind an almost-closed doorway casts a narrow ribbon of light & bounced caustic into dark studio!\nvec2 mapDoorRoom(vec3 p, float gap) {\n  float dFloor = p.y + 0.78;\n  float dBack = p.z + 1.25;\n  // Partition wall with narrow vertical doorway slit centered at x = -0.05\n  float wallZ = abs(p.z + 0.35) - 0.06;\n  float inSlit = step(abs(p.x + 0.05), gap * 0.5) * step(p.y, 0.62);\n  float dWall = (inSlit > 0.5) ? 1.0 : max(wallZ, p.y - 0.95);\n  // Keep outer frame solid around the doorway\n  float frameL = max(wallZ, -(p.x + 0.05 - gap * 0.5));\n  float frameR = max(wallZ, (p.x + 0.05 + gap * 0.5));\n  dWall = min(min(frameL, frameR), max(wallZ, 0.62 - p.y));\n  dWall = max(wallZ, min(abs(p.x + 0.05) < gap * 0.5 && p.y < 0.62 ? 0.5 : -0.1, 0.5));\n  // Clean SDF for wall with rectangular aperture\n  vec2 ap = abs(vec2(p.x + 0.05, p.y + 0.08)) - vec2(gap * 0.5, 0.70);\n  float dAp = length(max(ap, 0.0)) + min(max(ap.x, ap.y), 0.0);\n  dWall = max(wallZ, -dAp);\n\n  vec2 res = vec2(dFloor, 1.0);\n  if (dBack < res.x) res = vec2(dBack, 2.0); // bright lit back room\n  if (dWall < res.x) res = vec2(dWall, 3.0); // partition wall\n\n  // Foreground sculptural glass/marble pedestal receiving the difficult doorway bounce light\n  float dOrb = length(p - vec3(0.42, -0.44, 0.38)) - 0.34;\n  if (dOrb < res.x) res = vec2(dOrb, 4.0);\n  float dCube = length(max(abs(p - vec3(-0.46, -0.50, 0.45)) - vec3(0.24, 0.28, 0.24), 0.0));\n  if (dCube < res.x) res = vec2(dCube, 5.0);\n  return res;\n}\n\nvec3 calcNormal(vec3 p, float gap) {\n  vec2 e = vec2(0.003, 0.0);\n  return normalize(vec3(\n    mapDoorRoom(p + e.xyy, gap).x - mapDoorRoom(p - e.xyy, gap).x,\n    mapDoorRoom(p + e.yxy, gap).x - mapDoorRoom(p - e.yxy, gap).x,\n    mapDoorRoom(p + e.yyx, gap).x - mapDoorRoom(p - e.yyx, gap).x\n  ));\n}\n\nvec3 aces(vec3 x) {\n  x = max(x, 0.0);\n  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float screenX = fragCoord.x / max(iResolution.x, 1.0);\n  float split = clamp(P_SPLIT, 0.0, 1.0);\n  bool isMLT = screenX >= split;\n  float gap = clamp(P_DOOR_GAP, 0.06, 0.48);\n  float mltGain = clamp(P_MCMC_GAIN, 0.25, 1.8);\n  float animT = iTime * max(P_CHAIN_ANIM, 0.0);\n\n  vec3 ro = vec3(0.0, 0.14, 2.08);\n  vec3 rd = normalize(vec3(uv - vec2(0.0, 0.06), -1.35));\n\n  float t = 0.05;\n  vec2 hit = vec2(10.0, 0.0);\n  for (int i = 0; i < 64; i++) {\n    vec2 h = mapDoorRoom(ro + rd * t, gap);\n    if (h.x < 0.003) { hit = vec2(t, h.y); break; }\n    t += h.x;\n    if (t > 8.0) break;\n  }\n\n  vec3 col = vec3(0.015, 0.018, 0.028);\n  if (hit.y > 0.5) {\n    vec3 p = ro + rd * hit.x;\n    vec3 n = calcNormal(p, gap);\n\n    if (hit.y > 1.5 && hit.y < 2.5) {\n      // Bright sun-drenched room visible through the narrow doorway slit\n      col = vec3(3.2, 2.55, 1.75);\n    } else {\n      vec3 alb = vec3(0.56, 0.58, 0.64);\n      if (hit.y > 2.5 && hit.y < 3.5) alb = vec3(0.32, 0.36, 0.44);\n      else if (hit.y > 3.5 && hit.y < 4.5) alb = vec3(0.92, 0.72, 0.48);\n      else if (hit.y > 4.5) alb = vec3(0.38, 0.72, 0.86);\n\n      // Slit portal center at (-0.05, -0.08, -0.35)\n      vec3 portal = vec3(-0.05, 0.05, -0.35);\n      vec3 toP = portal - p;\n      float distP = length(toP);\n      vec3 dirP = toP / max(distP, 1e-4);\n\n      // Directional beam squeezing through narrow doorway gap onto foreground floor & objects\n      float beamAlign = exp(-pow((p.x + 0.05 - (p.z + 0.35) * 0.28) / max(gap * 0.65 + (p.z + 0.35) * 0.14, 0.05), 2.0));\n      float inFront = smoothstep(-0.35, -0.15, p.z);\n      float slitDirect = beamAlign * inFront * max(dot(n, dirP), 0.0) * (1.8 / (0.4 + distP * distP));\n      // Soft secondary bounce filled by Markov chain local mutations exploring the bright path neighborhood\n      float bounce = (0.42 / (0.65 + distP * distP)) * (0.35 + 0.65 * max(dot(n, dirP), 0.0)) * inFront;\n\n      vec3 converged = alb * (vec3(1.0, 0.84, 0.60) * (slitDirect + bounce * 0.85) + vec3(0.03, 0.04, 0.06));\n\n      if (isMLT) {\n        // Right: MLT locks Markov chains onto the doorway slit -> clean bright shaft & rich indirect glow!\n        col = converged * mltGain;\n        // Subtle animated MCMC local mutation sparks dancing inside the discovered light shaft\n        float spark = exp(-abs(sin(p.x * 22.0 + animT * 3.0) * cos(p.z * 22.0 - animT * 2.4)) * 18.0) * beamAlign * inFront;\n        col += vec3(0.28, 0.96, 0.92) * spark * 0.22;\n      } else {\n        // Left: Naive path tracer rarely hits the narrow gap -> dark, noisy, blotchy fireflies!\n        vec2 pix = floor(fragCoord * 0.65);\n        float fr = floor(iTime * 9.0) * 0.11;\n        float r1 = hash21(pix + vec2(fr * 19.1, 5.7));\n        float r2 = hash21(pix * 1.31 + vec2(11.3, fr * 29.3));\n        float hitProb = clamp(gap * 1.4, 0.12, 0.55);\n        float survived = step(1.0 - hitProb, r1);\n        float firefly = smoothstep(0.955, 0.998, r2) * 4.8 * (0.25 + slitDirect);\n        col = converged * (0.14 + 0.95 * survived * r1) + alb * vec3(1.0, 0.85, 0.62) * firefly;\n      }\n    }\n  }\n\n  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));\n  col = mix(col, vec3(0.95, 0.97, 1.0), sep);\n\n  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "metropolis-light-transport",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T20:35:53.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.2421,
      "std": 0.2622,
      "min": 0.0314,
      "max": 0.9846
     },
     "image": "/specimens/metropolis-light-transport-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "path-tracing",
  "bidirectional-path-tracing",
  "path-guiding"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "bidirectional-path-tracing",
   "why": "Mutating the random numbers of a BDPT sampler lets the chain reuse its connection strategies."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/gi/metropolis-light-transport.json"
 },
 "solves": [
  "scene lit through a small gap is very noisy",
  "caustics and nested glass converge slowly",
  "path tracing struggles when light paths are rare",
  "pool caustics or lamp in glass full of fireflies"
 ],
 "authority": "Veach & Guibas, 1997",
 "url": "https://texelatlas.vercel.app/t/metropolis-light-transport/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 13.15,
  "tier": "moderate",
  "p50_ms": 0.4325,
  "p95_ms": 0.4549,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "metropolis-light-transport-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 12.17,
   "tier": "moderate",
   "p50_ms": 0.1935,
   "p95_ms": 0.1941,
   "speedup_x": 2.24,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 8.19,
   "tier": "moderate",
   "p50_ms": 0.236,
   "p95_ms": 0.2364,
   "speedup_x": 1.83,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}