---
id: "manifold-next-event-estimation"
title: "Manifold Next-Event Estimation and Specular Manifold Sampling"
aliases: [MNEE, SMS, Specular Manifold Sampling, manifold walk]
domain: "gi"
stage: "lighting"
realtime: "interactive"
platforms: [webgpu, desktop-gpu, cuda, cpu]
year_introduced: 2015
inputs: [mesh, material-params, normals]
outputs: [radiance]
style: "photoreal"
dynamic: "dynamic"
cost: "heavy"
authority: "Hanika et al., 2015"
url: "https://texelatlas.vercel.app/t/manifold-next-event-estimation/"
sources_verified_at: "2026-11-30"
---
# Manifold Next-Event Estimation and Specular Manifold Sampling (Hanika et al., 2015)

> 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.

## Reach for it when

- 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

## 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.

Linearizing 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.

**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 it

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.

Prefer [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

heavy — 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.
Measured GPU Weight: 2.82× baseline (light) — 0.0929 ms median / 0.0952 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 2.4× baseline (light) — 0.0381 ms median (2.44× faster on L4).
Ampere A100 scaling: 1.81× baseline (feather) — 0.0521 ms median (1.78× faster on A100).

## 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

## Engine support

- blender: builtin — `Cycles > Object Properties > Shading > Caustics (Shadow Caustics via Manifold Next Event Estimation in intern/cycles/kernel/integrator/mnee.h)` (evidence: https://github.com/blender/blender/blob/main/intern/cycles/kernel/integrator/mnee.h, checked 2026-12-01)

## Dataflow

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

## Presets

### Manifold Next Event Estimation (MNEE) — dark occluded glass shadow (left) vs specular-manifold Newton caustic (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_IOR": 1.52,
  "P_WAVE_RIPPLE": 0.75,
  "P_LIGHT_SWAY": 0.65,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_IOR = 1.52; // P Glass IOR [1.15, 2.1, 0.02]
const float P_WAVE_RIPPLE = 0.75; // P Refractive Ripple [0.0, 1.4, 0.04]
const float P_LIGHT_SWAY = 0.65; // P Light Motion [0.0, 2.2, 0.05]
const float P_SPLIT = 0.48; // P Direct / MNEE Split [0.0, 1.0, 0.02]

// Refractive water-glass lens sphere with gentle surface undulation
float lensHeight(vec3 p, float ripple, float t) {
  return 0.018 * ripple * sin(p.x * 12.0 + t * 2.0) * cos(p.z * 12.0 - t * 1.6);
}

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 isMNEE = screenX >= split;
  float ior = clamp(P_IOR, 1.1, 2.2);
  float ripple = clamp(P_WAVE_RIPPLE, 0.0, 1.5);
  float swayT = iTime * max(P_LIGHT_SWAY, 0.0);

  vec3 ro = vec3(0.0, 0.88, 2.22);
  vec3 rd = normalize(vec3(uv.x, uv.y - 0.30, -1.45));
  vec3 bg = mix(vec3(0.022, 0.028, 0.046), vec3(0.068, 0.088, 0.135), smoothstep(-0.5, 0.5, uv.y));
  vec3 col = bg;

  vec3 lDir = normalize(vec3(0.32 * sin(swayT * 0.6), 0.92, 0.25 * cos(swayT * 0.6)));
  vec3 sc = vec3(0.0, 0.14, 0.0);
  float rad = 0.48;

  // Intersect glass sphere & studio floor plane at y = -0.36
  vec3 oc = ro - sc;
  float b = dot(oc, rd);
  float c = dot(oc, oc) - rad * rad;
  float disc = b * b - c;
  float tSph = (disc > 0.0 && (-b - sqrt(disc)) > 0.05) ? (-b - sqrt(disc)) : 1e5;
  float tFl = (rd.y < -0.01) ? ((-0.36 - ro.y) / rd.y) : 1e5;
  if (tFl < 0.05 || tFl > 12.0) tFl = 1e5;

  if (tSph < tFl && tSph < 1e4) {
    // Shaded dielectric glass lens orb
    vec3 p = ro + rd * tSph;
    vec3 n = normalize(p - sc + vec3(
      0.08 * ripple * cos(p.x * 12.0 + swayT * 2.0),
      0.0,
      -0.08 * ripple * sin(p.z * 12.0 - swayT * 1.6)
    ));
    float ndv = max(dot(n, -rd), 0.0);
    float f0 = pow((ior - 1.0) / (ior + 1.0), 2.0);
    float fres = f0 + (1.0 - f0) * pow(1.0 - ndv, 5.0);

    vec3 refrD = refract(rd, n, 1.0 / ior);
    vec3 pExit = p + refrD * 0.72;
    vec3 nExit = -normalize(pExit - sc);
    vec3 rOut = refract(refrD, nExit, ior);
    if (length(rOut) < 0.01) rOut = reflect(refrD, nExit);

    // Refracted checkerboard floor visible through glass orb
    vec3 refrCol = bg;
    if (rOut.y < -0.01) {
      float tf2 = (-0.36 - pExit.y) / rOut.y;
      vec3 fp2 = pExit + rOut * max(tf2, 0.0);
      vec2 chk = floor(fp2.xz * 2.5);
      refrCol = mix(vec3(0.24, 0.28, 0.34), vec3(0.74, 0.76, 0.80), mod(chk.x + chk.y, 2.0));
    }
    vec3 reflD = reflect(rd, n);
    float spec = pow(max(dot(n, normalize(lDir - rd)), 0.0), 96.0);
    vec3 env = mix(vec3(0.08, 0.14, 0.24), vec3(0.75, 0.84, 0.96), smoothstep(0.0, 0.8, reflD.y));
    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;
  } else if (tFl < 1e4) {
    vec3 p = ro + rd * tFl;
    vec2 chk = floor(p.xz * 2.5);
    vec3 floorAlb = mix(vec3(0.20, 0.24, 0.30), vec3(0.68, 0.70, 0.74), mod(chk.x + chk.y, 2.0));

    // Geometric shadow footprint cast by refractive orb on floor
    vec3 toL = lDir;
    vec3 shadowCenter = sc - lDir * ((sc.y + 0.36) / max(lDir.y, 0.1));
    vec2 rel = p.xz - shadowCenter.xz;
    float rShadow = length(rel);
    float inShadow = smoothstep(rad * 1.06, rad * 0.92, rShadow);

    vec3 direct = floorAlb * (0.20 + 0.82 * (1.0 - inShadow * 0.88));

    if (isMNEE) {
      // Right: MNEE solves the specular manifold constraint c(x_m) = 0 via Newton iterations to connect p -> glass -> light!
      // Focused refractive caustic core + rippled lens dispersion fringes inside the refractive shadow!
      float focusPower = clamp((ior - 1.05) * 1.8, 0.2, 2.2);
      vec2 warp = rel + vec2(
        0.045 * ripple * sin(rel.x * 16.0 + swayT * 2.0),
        0.045 * ripple * cos(rel.y * 16.0 - swayT * 1.6)
      );
      float rW = length(warp);
      // Bright focused spherical-aberration caustic spot + bright peripheral ring inside shadow
      float core = exp(-rW * rW * (22.0 + 18.0 * focusPower)) * (1.6 + 1.4 * focusPower);
      float ring = exp(-pow((rW - rad * 0.62 / max(focusPower * 0.6 + 0.5, 0.6)) * 18.0, 2.0)) * 0.85;
      float rippleWeb = (0.5 + 0.5 * sin(warp.x * 26.0 + warp.y * 18.0)) * 0.25 * ripple;
      // Subtle chromatic RGB dispersion from Snell's law Jacobian determinant
      vec3 causticRGB = vec3(
        exp(-pow(rW * 1.04, 2.0) * 28.0),
        exp(-pow(rW * 1.00, 2.0) * 28.0),
        exp(-pow(rW * 0.96, 2.0) * 28.0)
      ) * (1.8 + focusPower) + vec3(0.98, 0.88, 0.68) * (ring + rippleWeb) * inShadow;
      col = direct + floorAlb * causticRGB * inShadow * 1.25 + vec3(1.0, 0.94, 0.80) * core * 0.45 * inShadow;
    } else {
      // Left: Standard NEE treats dielectric glass as an opaque shadow blocker -> pitch-dark shadow with zero caustic!
      col = direct;
    }
    col = mix(col, bg, 1.0 - exp(-tFl * 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 [Next-event estimation (direct light sampling)](https://texelatlas.vercel.app/t/next-event-estimation.md)

## Combines with

- [Unidirectional Path Tracing](https://texelatlas.vercel.app/t/path-tracing.md): Provides an explicit caustic estimator at diffuse vertices inside a standard unidirectional path tracer.
- [Multiple Importance Sampling](https://texelatlas.vercel.app/t/multiple-importance-sampling.md): Blends manifold caustic connections with BSDF-sampled glossy paths to handle moderately rough specular interfaces.

## Combination ideas

- [Dispersive manifold caustics denoised with joint NLM](https://texelatlas.vercel.app/ideas/spectral-mnee-jnlm-caustics/)

## Sources

1. [primary] Johannes Hanika, Marc Droske, Luca Fascione (2015) Manifold Next Event Estimation. Computer Graphics Forum. https://doi.org/10.1111/cgf.12681 (verified via crossref on 2026-11-30)
2. [primary] Tizian Zeltner, Iliyan Georgiev, Wenzel Jakob (2020) Specular manifold sampling for rendering high-frequency caustics and glints. ACM Transactions on Graphics. https://doi.org/10.1145/3386569.3392408 (verified via crossref on 2026-11-30)
3. [secondary] Wenzel Jakob, Steve Marschner (2012) Manifold exploration. ACM Transactions on Graphics. https://doi.org/10.1145/2185520.2185554 (verified via crossref on 2026-11-30)
4. [implementation] pissang (2026) pissang/mutracer. https://github.com/pissang/mutracer License: MIT. (verified via github on 2026-11-30)

## Cite this entry

Texel. "Manifold Next-Event Estimation and Specular Manifold Sampling." https://texelatlas.vercel.app/t/manifold-next-event-estimation/ (accessed 2026-12-01).
