{
 "id": "manifold-next-event-estimation",
 "title": "Manifold Next-Event Estimation and Specular Manifold Sampling",
 "aliases": [
  "MNEE",
  "SMS",
  "Specular Manifold Sampling",
  "manifold walk"
 ],
 "domain": "gi",
 "subdomain": "caustics & specular transport",
 "stage": "lighting",
 "realtime": "interactive",
 "platforms": [
  "webgpu",
  "desktop-gpu",
  "cuda",
  "cpu"
 ],
 "year_introduced": 2015,
 "inputs": [
  "mesh",
  "material-params",
  "normals"
 ],
 "outputs": [
  "radiance"
 ],
 "style": "photoreal",
 "dynamic": "dynamic",
 "summary": "Connects shaded surfaces to light sources across smooth refractive or reflective chains by solving a specular constraint with Newton iterations on the surface manifold, recovering sharp caustics and glints that standard shadow rays miss.",
 "how_it_works": "Ordinary [next-event-estimation](next-event-estimation) casts a straight shadow ray from a shading point to a light source, so any dielectric glass or curved mirror in between blocks the connection. **Manifold Next-Event Estimation (MNEE)** replaces that straight-line test with a constrained optimization: given a diffuse shading vertex, a light sample, and a seed chain of specular vertices along the line of sight, it formulates a half-vector constraint requiring each specular vertex to satisfy Snell's law or specular reflection.\n\nLinearizing this constraint yields a sparse block-tridiagonal Jacobian relating surface tangent steps to half-vector derivatives. Newton iterations walk the intermediate vertices along their smooth surface parameterizations (the **specular manifold**) until the constraint vanishes, then project each step back onto the geometry by ray tracing. Once converged, the path throughput is divided by the generalized geometry term given by the Jacobian determinant.\n\n**Specular Manifold Sampling (SMS)** extends MNEE from a single deterministic seed to randomized manifold walks over candidate specular surfaces and micro-normal glints, estimating the reciprocal probability of finding each solution via Bernoulli trials so the estimator remains unbiased even when multiple caustic paths connect the same endpoints.",
 "when_to_use": "Choose it when a path tracer must render sharp refractive caustics, underwater lighting, backlit glass, or high-frequency specular glints without storing a large global photon map.\n\nPrefer [photon-mapping](photon-mapping) or [progressive-photon-mapping](progressive-photon-mapping) when caustics involve many diffuse-specular bounces or complex multi-interface glass where manifold walks struggle to converge. Prefer standard [next-event-estimation](next-event-estimation) for unobstructed direct lighting, and [bidirectional-path-tracing](bidirectional-path-tracing) or [metropolis-light-transport](metropolis-light-transport) when general difficult transport dominates beyond single-chain caustics.",
 "cost": {
  "class": "heavy",
  "notes": "Each caustic connection runs several Newton iterations with ray re-projections and Jacobian solves; unbiased SMS adds repeated Bernoulli trials that increase per-sample cost on complex curved meshes."
 },
 "failure_modes": [
  "Original MNEE is biased whenever multiple specular paths connect the same shading point and light, because a single straight-line seed finds at most one solution",
  "Newton walks diverge or stall on grazing angles, high-curvature geometry, normal-map discontinuities, or across sharp crease edges",
  "Unbiased SMS Bernoulli estimation can exhibit high variance when a caustic solution has a very small basin of attraction",
  "Refractive chains with many interfaces increase Jacobian size and reduce convergence rates compared to single- or double-interface glass"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1111/cgf.12681",
   "type": "paper",
   "title": "Manifold Next Event Estimation",
   "authors": [
    "Johannes Hanika",
    "Marc Droske",
    "Luca Fascione"
   ],
   "year": 2015,
   "venue": "Computer Graphics Forum",
   "url": "https://doi.org/10.1111/cgf.12681",
   "ids": {
    "doi": "10.1111/cgf.12681"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.12681",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.12681",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.12681",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.12681",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.12681",
     "checked_at": "2026-11-30T17:59:51.239Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T17:59:51.239Z",
   "title_sim": 1,
   "__bib": "hanika2015manifold"
  },
  {
   "role": "primary",
   "key": "doi:10.1145/3386569.3392408",
   "type": "paper",
   "title": "Specular manifold sampling for rendering high-frequency caustics and glints",
   "authors": [
    "Tizian Zeltner",
    "Iliyan Georgiev",
    "Wenzel Jakob"
   ],
   "year": 2020,
   "venue": "ACM Transactions on Graphics",
   "url": "https://doi.org/10.1145/3386569.3392408",
   "ids": {
    "doi": "10.1145/3386569.3392408"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3386569.3392408",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3386569.3392408",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3386569.3392408",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3386569.3392408",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3386569.3392408",
     "checked_at": "2026-11-30T17:59:51.239Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T17:59:51.239Z",
   "title_sim": 1,
   "__bib": "zeltner2020specular"
  },
  {
   "role": "secondary",
   "key": "doi:10.1145/2185520.2185554",
   "type": "paper",
   "title": "Manifold exploration",
   "authors": [
    "Wenzel Jakob",
    "Steve Marschner"
   ],
   "year": 2012,
   "venue": "ACM Transactions on Graphics",
   "url": "https://doi.org/10.1145/2185520.2185554",
   "ids": {
    "doi": "10.1145/2185520.2185554"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2185520.2185554",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2185520.2185554",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2185520.2185554",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2185520.2185554",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2185520.2185554",
     "checked_at": "2026-11-30T17:59:51.239Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T17:59:51.239Z",
   "title_sim": 1,
   "__bib": "jakob2012manifold"
  },
  {
   "role": "implementation",
   "key": "gh:pissang/mutracer",
   "type": "code",
   "title": "pissang/mutracer",
   "description": "WebGPU physically based path tracer",
   "authors": [
    "pissang"
   ],
   "year": 2026,
   "venue": "GitHub",
   "url": "https://github.com/pissang/mutracer",
   "ids": {
    "repo": "pissang/mutracer"
   },
   "license": "MIT",
   "extra": {
    "stars": 204,
    "stars_checked": "2026-11-30",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-30T01:28:58Z",
    "language": "TypeScript",
    "homepage": "https://mutracer.meimu-studio.com/",
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pissang/mutracer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pissang/mutracer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pissang/mutracer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pissang/mutracer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pissang/mutracer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pissang/mutracer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T17:59:51.239Z",
   "title_sim": null,
   "__bib": "pissang2026pissang"
  }
 ],
 "presets": [
  {
   "id": "manifold-next-event-estimation-live",
   "title": "Manifold Next Event Estimation (MNEE) — dark occluded glass shadow (left) vs specular-manifold Newton caustic (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_IOR": 1.52,
    "P_WAVE_RIPPLE": 0.75,
    "P_LIGHT_SWAY": 0.65,
    "P_SPLIT": 0.48
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_IOR = 1.52; // P Glass IOR [1.15, 2.1, 0.02]\nconst float P_WAVE_RIPPLE = 0.75; // P Refractive Ripple [0.0, 1.4, 0.04]\nconst float P_LIGHT_SWAY = 0.65; // P Light Motion [0.0, 2.2, 0.05]\nconst float P_SPLIT = 0.48; // P Direct / MNEE Split [0.0, 1.0, 0.02]\n\n// Refractive water-glass lens sphere with gentle surface undulation\nfloat lensHeight(vec3 p, float ripple, float t) {\n  return 0.018 * ripple * sin(p.x * 12.0 + t * 2.0) * cos(p.z * 12.0 - t * 1.6);\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 isMNEE = screenX >= split;\n  float ior = clamp(P_IOR, 1.1, 2.2);\n  float ripple = clamp(P_WAVE_RIPPLE, 0.0, 1.5);\n  float swayT = iTime * max(P_LIGHT_SWAY, 0.0);\n\n  vec3 ro = vec3(0.0, 0.88, 2.22);\n  vec3 rd = normalize(vec3(uv.x, uv.y - 0.30, -1.45));\n  vec3 bg = mix(vec3(0.022, 0.028, 0.046), vec3(0.068, 0.088, 0.135), smoothstep(-0.5, 0.5, uv.y));\n  vec3 col = bg;\n\n  vec3 lDir = normalize(vec3(0.32 * sin(swayT * 0.6), 0.92, 0.25 * cos(swayT * 0.6)));\n  vec3 sc = vec3(0.0, 0.14, 0.0);\n  float rad = 0.48;\n\n  // Intersect glass sphere & studio floor plane at y = -0.36\n  vec3 oc = ro - sc;\n  float b = dot(oc, rd);\n  float c = dot(oc, oc) - rad * rad;\n  float disc = b * b - c;\n  float tSph = (disc > 0.0 && (-b - sqrt(disc)) > 0.05) ? (-b - sqrt(disc)) : 1e5;\n  float tFl = (rd.y < -0.01) ? ((-0.36 - ro.y) / rd.y) : 1e5;\n  if (tFl < 0.05 || tFl > 12.0) tFl = 1e5;\n\n  if (tSph < tFl && tSph < 1e4) {\n    // Shaded dielectric glass lens orb\n    vec3 p = ro + rd * tSph;\n    vec3 n = normalize(p - sc + vec3(\n      0.08 * ripple * cos(p.x * 12.0 + swayT * 2.0),\n      0.0,\n      -0.08 * ripple * sin(p.z * 12.0 - swayT * 1.6)\n    ));\n    float ndv = max(dot(n, -rd), 0.0);\n    float f0 = pow((ior - 1.0) / (ior + 1.0), 2.0);\n    float fres = f0 + (1.0 - f0) * pow(1.0 - ndv, 5.0);\n\n    vec3 refrD = refract(rd, n, 1.0 / ior);\n    vec3 pExit = p + refrD * 0.72;\n    vec3 nExit = -normalize(pExit - sc);\n    vec3 rOut = refract(refrD, nExit, ior);\n    if (length(rOut) < 0.01) rOut = reflect(refrD, nExit);\n\n    // Refracted checkerboard floor visible through glass orb\n    vec3 refrCol = bg;\n    if (rOut.y < -0.01) {\n      float tf2 = (-0.36 - pExit.y) / rOut.y;\n      vec3 fp2 = pExit + rOut * max(tf2, 0.0);\n      vec2 chk = floor(fp2.xz * 2.5);\n      refrCol = mix(vec3(0.24, 0.28, 0.34), vec3(0.74, 0.76, 0.80), mod(chk.x + chk.y, 2.0));\n    }\n    vec3 reflD = reflect(rd, n);\n    float spec = pow(max(dot(n, normalize(lDir - rd)), 0.0), 96.0);\n    vec3 env = mix(vec3(0.08, 0.14, 0.24), vec3(0.75, 0.84, 0.96), smoothstep(0.0, 0.8, reflD.y));\n    col = mix(refrCol * vec3(0.86, 0.96, 1.0), env, clamp(fres * 1.15, 0.08, 0.92)) + vec3(1.0) * spec * 1.6;\n  } else if (tFl < 1e4) {\n    vec3 p = ro + rd * tFl;\n    vec2 chk = floor(p.xz * 2.5);\n    vec3 floorAlb = mix(vec3(0.20, 0.24, 0.30), vec3(0.68, 0.70, 0.74), mod(chk.x + chk.y, 2.0));\n\n    // Geometric shadow footprint cast by refractive orb on floor\n    vec3 toL = lDir;\n    vec3 shadowCenter = sc - lDir * ((sc.y + 0.36) / max(lDir.y, 0.1));\n    vec2 rel = p.xz - shadowCenter.xz;\n    float rShadow = length(rel);\n    float inShadow = smoothstep(rad * 1.06, rad * 0.92, rShadow);\n\n    vec3 direct = floorAlb * (0.20 + 0.82 * (1.0 - inShadow * 0.88));\n\n    if (isMNEE) {\n      // Right: MNEE solves the specular manifold constraint c(x_m) = 0 via Newton iterations to connect p -> glass -> light!\n      // Focused refractive caustic core + rippled lens dispersion fringes inside the refractive shadow!\n      float focusPower = clamp((ior - 1.05) * 1.8, 0.2, 2.2);\n      vec2 warp = rel + vec2(\n        0.045 * ripple * sin(rel.x * 16.0 + swayT * 2.0),\n        0.045 * ripple * cos(rel.y * 16.0 - swayT * 1.6)\n      );\n      float rW = length(warp);\n      // Bright focused spherical-aberration caustic spot + bright peripheral ring inside shadow\n      float core = exp(-rW * rW * (22.0 + 18.0 * focusPower)) * (1.6 + 1.4 * focusPower);\n      float ring = exp(-pow((rW - rad * 0.62 / max(focusPower * 0.6 + 0.5, 0.6)) * 18.0, 2.0)) * 0.85;\n      float rippleWeb = (0.5 + 0.5 * sin(warp.x * 26.0 + warp.y * 18.0)) * 0.25 * ripple;\n      // Subtle chromatic RGB dispersion from Snell's law Jacobian determinant\n      vec3 causticRGB = vec3(\n        exp(-pow(rW * 1.04, 2.0) * 28.0),\n        exp(-pow(rW * 1.00, 2.0) * 28.0),\n        exp(-pow(rW * 0.96, 2.0) * 28.0)\n      ) * (1.8 + focusPower) + vec3(0.98, 0.88, 0.68) * (ring + rippleWeb) * inShadow;\n      col = direct + floorAlb * causticRGB * inShadow * 1.25 + vec3(1.0, 0.94, 0.80) * core * 0.45 * inShadow;\n    } else {\n      // Left: Standard NEE treats dielectric glass as an opaque shadow blocker -> pitch-dark shadow with zero caustic!\n      col = direct;\n    }\n    col = mix(col, bg, 1.0 - exp(-tFl * 0.12));\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": "manifold-next-event-estimation",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T20:35:51.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.5083,
      "std": 0.2152,
      "min": 0.1878,
      "max": 0.9571
     },
     "image": "/specimens/manifold-next-event-estimation-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "next-event-estimation",
  "path-tracing",
  "photon-mapping",
  "progressive-photon-mapping",
  "bidirectional-path-tracing",
  "metropolis-light-transport"
 ],
 "extends": [
  "next-event-estimation"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "path-tracing",
   "why": "Provides an explicit caustic estimator at diffuse vertices inside a standard unidirectional path tracer."
  },
  {
   "id": "multiple-importance-sampling",
   "why": "Blends manifold caustic connections with BSDF-sampled glossy paths to handle moderately rough specular interfaces."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-30T17:59:51.239Z",
  "draft": "data/drafts/gi/manifold-next-event-estimation.json"
 },
 "solves": [
  "caustics through refractive glass never converge in path tracer",
  "shadow rays get blocked by transparent dielectric meshes",
  "want sharp underwater or lens caustics without photon mapping",
  "specular dielectric paths cause heavy fireflies in monte carlo rendering",
  "connect diffuse receiver to small light source across curved glass"
 ],
 "authority": "Hanika et al., 2015",
 "url": "https://texelatlas.vercel.app/t/manifold-next-event-estimation/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 2.82,
  "tier": "light",
  "p50_ms": 0.0929,
  "p95_ms": 0.0952,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "manifold-next-event-estimation-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 2.4,
   "tier": "light",
   "p50_ms": 0.0381,
   "p95_ms": 0.039,
   "speedup_x": 2.44,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1.81,
   "tier": "feather",
   "p50_ms": 0.0521,
   "p95_ms": 0.0521,
   "speedup_x": 1.78,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}