{
 "id": "exponential-variance-shadow-maps",
 "title": "Exponential Variance Shadow Maps",
 "aliases": [],
 "domain": "visibility",
 "subdomain": "prefiltered shadow maps",
 "stage": "visibility",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "unity",
  "unreal",
  "godot"
 ],
 "year_introduced": 2008,
 "inputs": [
  "depth"
 ],
 "outputs": [
  "visibility-mask"
 ],
 "style": "both",
 "dynamic": "dynamic",
 "summary": "Warps depth through exponentials before storing moments, which drastically reduces the light bleeding of plain variance shadow maps while keeping the map filterable.",
 "how_it_works": "EVSM applies the monotonic warps exp(c*z) and -exp(-c*z) to depth, then stores the first two moments of each warped value (four channels). Filtering happens in warped space, and at shade time Chebyshev's bound is evaluated on both the positive and negative warp, taking the minimum. The exponential stretches small depth differences so that occluders only slightly in front of a receiver are separated cleanly, which is what plain VSM cannot do. The constant c trades bleeding against precision: large values need 32-bit float storage to avoid overflow and quantisation, and a pure exponential variant (ESM) drops the variance and keeps one channel.",
 "when_to_use": "Choose it when you want blurrable soft shadows and plain VSM leaks too much, and your target supports float32 render targets. Prefer `moment-shadow-maps` when you want a more principled bound with a cleaner artifact profile, `variance-shadow-maps` when memory is tight, and `percentage-closer-filtering` when robustness beats softness.",
 "cost": {
  "class": "cheap",
  "notes": "Four 32-bit channels per texel; roughly 4x the bandwidth of a depth map before filtering."
 },
 "failure_modes": [
  "Float precision or overflow at large exponent constants",
  "Residual bleeding with complex overlapping occluders",
  "Memory-heavy for many cascades or lights",
  "Banding or darkening if the exponent is tuned too aggressively"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1201/b11325-21",
   "type": "chapter",
   "title": "Variance Shadow Maps Light-Bleeding Reduction Tricks",
   "authors": [],
   "year": 2016,
   "venue": "GPU Pro 2",
   "url": "https://doi.org/10.1201/b11325-21",
   "ids": {
    "doi": "10.1201/b11325-21"
   },
   "license": null,
   "extra": {
    "csl_type": "book-chapter"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1201/b11325-21",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1201/b11325-21",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1201/b11325-21",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1201/b11325-21",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1201/b11325-21",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "anon2016variance"
  },
  {
   "role": "tutorial",
   "key": "url:https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps",
   "type": "tutorial",
   "title": "Summed-Area Variance Shadow Maps",
   "authors": [
    "Andrew Lauritzen"
   ],
   "year": null,
   "venue": "developer.nvidia.com",
   "url": "https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20260412002946/https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps",
     "timestamp": "20260412002946"
    },
    "page_title": "Chapter 8. Summed-Area Variance Shadow Maps",
    "host": "developer.nvidia.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps → 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://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps → 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": "lauritzensummed"
  }
 ],
 "presets": [
  {
   "id": "exponential-variance-shadow-maps-specimen",
   "title": "Visibility behind two overlapping occluders (depth profile on top). White exact, orange VSM (light bleeds in the middle), cyan EVSM",
   "runtime": "glsl-fragment",
   "params": {
    "W": 0.09,
    "EC": 20,
    "TR": 1
   },
   "code": "float hash(vec2 c){uvec2 u=uvec2(ivec2(floor(c)));uint h=u.x*1597334673u^u.y*3812015801u;h^=h>>15;h*=2246822519u;h^=h>>13;h*=3266489917u;h^=h>>16;return float(h)*(1./4294967296.);}\nfloat lum(vec3 c){return dot(c,vec3(.2126,.7152,.0722));}\nvec3 gam(vec3 c){return pow(clamp(c,0.,1.),vec3(1./2.2));}\n\nconst float W=0.09; // P\nconst float EC=20.0; // P\nconst float TR=1.0; // P\nfloat mapD(float x){float d=1.;if(x>.12&&x<.45)d=min(d,.08);if(x>.4&&x<.78)d=min(d,.6);return d;}\nfloat cheb(float mu,float m2,float t,float mv){float v=max(m2-mu*mu,mv);return t<=mu?1.:v/(v+(t-mu)*(t-mu));}\nfloat exact(float x){return mapD(x)<TR-.01?0.:1.;}\nfloat vsm(float x){float a=0.,b=0.;for(int i=0;i<41;i++){float d=mapD(x+(float(i)/40.-.5)*2.*W);a+=d;b+=d*d;}a/=41.;b/=41.;return cheb(a,b,TR-.01,1e-4);}\nfloat evsm(float x){float p1=0.,p2=0.,q1=0.,q2=0.;\n  for(int i=0;i<41;i++){float d=mapD(x+(float(i)/40.-.5)*2.*W);float e=exp(EC*(d-1.)),f=exp(-EC*d);p1+=e;p2+=e*e;q1+=f;q2+=f*f;}\n  p1/=41.;p2/=41.;q1/=41.;q2/=41.;float t=TR-.01;\n  return min(cheb(p1,p2,exp(EC*(t-1.)),1e-5),cheb(-q1,q2,-exp(-EC*t),1e-5));}\nvoid mainImage(out vec4 fragColor,in vec2 fragCoord){\n  vec2 u=fragCoord/iResolution.xy;float x=u.x;vec3 col=vec3(.07,.08,.11);\n  if(u.y>.55){float d=mapD(x),yy=(u.y-.55)/.45;\n    if(yy>1.-d*1.0+0.0&&d<.99)col=vec3(.25,.3,.4);\n    if(d>.99&&yy>.97)col=vec3(.2,.2,.25);}\n  float ph=.07+.36*(u.y)/.55*0.;\n  float yb=u.y/.5;\n  if(u.y<.5){\n    float lo=.06,sc=.38;\n    float y0=lo+sc*exact(x),y1=lo+sc*vsm(x),y2=lo+sc*evsm(x);\n    float yy=u.y;\n    col=mix(col,vec3(.9,.9,.9),smoothstep(.006,.002,abs(yy-y0)));\n    col=mix(col,vec3(1.,.55,.2),smoothstep(.007,.003,abs(yy-y1)));\n    col=mix(col,vec3(.3,.85,1.),smoothstep(.007,.003,abs(yy-y2)));\n    if(abs(yy-lo)<.001||abs(yy-lo-sc)<.001)col=mix(col,vec3(.35),.6);\n  }\n  fragColor=vec4(col,1.);\n}",
   "basis": "original",
   "license_note": "written for this index",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "exponential-variance-shadow-maps",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-29T15:51:50.471Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.1125,
      "std": 0.1,
      "unique_colors": 82
     },
     "image": "/specimens/exponential-variance-shadow-maps-specimen.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "variance-shadow-maps",
  "moment-shadow-maps"
 ],
 "extends": [
  "variance-shadow-maps"
 ],
 "supersedes": [],
 "combines_with": [],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/visibility/exponential-variance-shadow-maps.json"
 },
 "solves": [
  "variance shadow maps show light bleeding",
  "need prefilterable soft shadows with fewer artifacts",
  "blurred shadow maps leak light behind overlapping occluders",
  "want shadows that can be mipmapped and blurred on gpu"
 ],
 "authority": "2016",
 "url": "https://texelatlas.vercel.app/t/exponential-variance-shadow-maps/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 9.8,
  "tier": "moderate",
  "p50_ms": 0.3225,
  "p95_ms": 0.3328,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "exponential-variance-shadow-maps-specimen",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 10.13,
   "tier": "moderate",
   "p50_ms": 0.1611,
   "p95_ms": 0.1613,
   "speedup_x": 2,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 6.5,
   "tier": "moderate",
   "p50_ms": 0.1873,
   "p95_ms": 0.1874,
   "speedup_x": 1.72,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}