VSMShadowFilter
A high-performance soft shadow function based on Variance Shadow Mapping (VSM) technology, which generates very smooth, soft shadow edges using a single texture sample and mathematical calculations.
Core Advantages
Its core advantage is extremely high performance. Unlike PCF which requires multiple samples, VSM typically needs only a single texture read to achieve high-quality soft shadows, and it naturally produces a variable penumbra effect where shadows soften with distance.
Common Uses
Product showcases requiring both high performance and quality shadows.
Architectural visualization for simulating soft, natural sunlight.
Stylized games that need smooth shadows to match a soft art style.
As a high-performance alternative in scenes with many dynamic shadows to maintain a smooth framerate.
How to adjust
The effect of this node is not adjusted directly, but by configuring the light's shadow properties. First, you must set `light.shadow.mapType = THREE.VSMShadowMap` to enable VSM. The shadow's softness is primarily controlled by adjusting `light.shadow.radius`, where a larger value produces a blurrier shadow. Its variable penumbra effect (shadows softening with distance) is produced automatically.
Code Examples
1// The shadowMap node contains the VSM texture and related coordinates
2const shadowFactor = VSMShadowFilter( shadowMap );
3
4// Apply the VSM shadow factor to the lighting
5diffuseColor.rgb *= shadowFactor;