shadowMapFastNoise
shadowMapFastNoise(params : Object) : Node<float>Fast shadow map filtering using spatial noise and Poisson disk sampling.
Algorithm
- Generates 2 Poisson disk samples per fragment
- Uses world-position-based noise to rotate sample pattern
- Reduces banding artifacts with minimal performance cost
- Provides softer shadow edges than standard PCF
Usage
Performance
- Only 2 shadow map samples per fragment (vs 4-16 for standard PCF)
- Noise rotation provides perceptual quality of more samples
- Suitable for real-time applications
Parameters
paramsObjectShadow sampling parameters.
depthTextureNode<Texture>Shadow depth texture.shadowCoordNode<vec4>Projected shadow coordinates.shadowObjectShadow reference object containingmapSize.
Returns
Node<float> — Shadow factor in [0..1] (0=fully shadowed, 1=fully lit).Example
import { shadowMapFastNoise } from '@three-blocks/core';
const dirLight = new THREE.DirectionalLight(0xffffff, 1);
dirLight.castShadow = true;
dirLight.shadow.filterNode = shadowMapFastNoise;