Exponential Variance Shadow Maps
Warps depth through exponentials before storing moments, which drastically reduces the light bleeding of plain variance shadow maps while keeping the map filterable.
In the family Visibility, shadows & ambient occlusion, prefiltered shadow maps
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | |
| Unity | Built in | HDRP Asset > Lighting > Shadows > Area Shadow Filtering Quality = Medium (EVSM) docs HDRP only, used for area light shadows. |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
EVSM applies the monotonic warps exp(cz) and -exp(-cz) 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 choose it
Reach for it when
- 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
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.
Field marks
- 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
Presets
Visibility behind two overlapping occluders (depth profile on top). White exact, orange VSM (light bleeds in the middle), cyan EVSM
{
"W": 0.09,
"EC": 20,
"TR": 1
}Show GLSL (33 lines)
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.);}
float lum(vec3 c){return dot(c,vec3(.2126,.7152,.0722));}
vec3 gam(vec3 c){return pow(clamp(c,0.,1.),vec3(1./2.2));}
const float W=0.09; // P
const float EC=20.0; // P
const float TR=1.0; // P
float 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;}
float 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));}
float exact(float x){return mapD(x)<TR-.01?0.:1.;}
float 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);}
float evsm(float x){float p1=0.,p2=0.,q1=0.,q2=0.;
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;}
p1/=41.;p2/=41.;q1/=41.;q2/=41.;float t=TR-.01;
return min(cheb(p1,p2,exp(EC*(t-1.)),1e-5),cheb(-q1,q2,-exp(-EC*t),1e-5));}
void mainImage(out vec4 fragColor,in vec2 fragCoord){
vec2 u=fragCoord/iResolution.xy;float x=u.x;vec3 col=vec3(.07,.08,.11);
if(u.y>.55){float d=mapD(x),yy=(u.y-.55)/.45;
if(yy>1.-d*1.0+0.0&&d<.99)col=vec3(.25,.3,.4);
if(d>.99&&yy>.97)col=vec3(.2,.2,.25);}
float ph=.07+.36*(u.y)/.55*0.;
float yb=u.y/.5;
if(u.y<.5){
float lo=.06,sc=.38;
float y0=lo+sc*exact(x),y1=lo+sc*vsm(x),y2=lo+sc*evsm(x);
float yy=u.y;
col=mix(col,vec3(.9,.9,.9),smoothstep(.006,.002,abs(yy-y0)));
col=mix(col,vec3(1.,.55,.2),smoothstep(.007,.003,abs(yy-y1)));
col=mix(col,vec3(.3,.85,1.),smoothstep(.007,.003,abs(yy-y2)));
if(abs(yy-lo)<.001||abs(yy-lo-sc)<.001)col=mix(col,vec3(.35),.6);
}
fragColor=vec4(col,1.);
}Attribution: written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| exponential-variance-shadow-maps-specimen | Tesla T4 1920x1080 | 9.80× baseline (moderate) · 0.323 ms / 0.333 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| exponential-variance-shadow-maps-specimen | NVIDIA L4 1920x1080 | 10.1× baseline (moderate) · 0.161 ms / 0.161 ms · 2.0× faster on L4 | opengl-timer-query · Cross-architecture validation |
| exponential-variance-shadow-maps-specimen | NVIDIA A100-SXM4-40GB 1920x1080 | 6.50× baseline (moderate) · 0.187 ms / 0.187 ms · 1.7× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
Sources
- primary (2016). Variance Shadow Maps Light-Bleeding Reduction Tricks. GPU Pro 2.Verified via crossref · 2026-11-29doi:10.1201/b11325-21
- tutorialAndrew Lauritzen. Summed-Area Variance Shadow Maps. developer.nvidia.com.Verified via live page · 2026-11-29