PCFShadowFilter
A function node that implements the Percentage-Closer Filtering (PCF) algorithm to smooth out hard, aliased shadow edges, creating a more realistic and soft shadow effect.
Core Advantages
Dramatically simplifies the creation of high-quality soft shadows. It completely encapsulates complex low-level GLSL logic (like multi-point sampling, coordinate transformation, and result averaging) while leveraging GPU hardware acceleration for superior performance over manual implementations.
Common Uses
The standard method for achieving soft shadows in most real-time 3D applications.
Realistic rendering in games for characters, objects, and environments.
Architectural and product visualization to create a natural, high-end look and feel for lighting.
Any scene requiring soft, aesthetically pleasing shadow edges instead of hard, aliased ones.
How to adjust
This node has no adjustable parameters itself. The shadow's softness is primarily controlled by adjusting the light source's `light.shadow.radius` property; a higher value results in a blurrier, softer shadow edge. The overall sharpness and detail of the shadow are determined by `light.shadow.mapSize` (the shadow map resolution).
Code Examples
1// shadowMap is a ShadowMapNode instance containing all necessary shadow info
2const shadowFactor = PCFShadowFilter( shadowMap );
3
4// Apply the calculated soft shadow factor to the lighting
5diffuseColor.rgb *= shadowFactor;