Filtering
- Last UpdatedAug 22, 2023
- 1 minute read
While you cannot directly smooth the Shadow maps, you can smooth the results of the comparison between the Scene pixel and the Shadow map pixel.
filterMode parameter
The following filtering options are available by using the parameter csm/params/filterMode.
-
None: No filtering.
-
PCF: Percentage-Closer Filtering.

Parameters
This can be controlled by the following parameters.
KernelSize parameter
Parameter csm/pcf/kernelSize:
-
KernelSize: The size of the comparison kernel. The larger the kernel is, the more comparisons the pixel shader must perform.
BilinearSampling parameter
Parameter csm/pcf/bilinearSampling:
-
BilinearSampling: Enables the bilinear interpolation while doing the tests in order to smooth the results.
Note: This is valid for kernels 3×3 and up.
Gradient Bias
The csm/pcf/depthGradientBias parameter adds some additional instructions to the pixel shader.
-
depthGradientBias: Higher PCF kernels may introduce another biasing error that can be automatically resolved by enabling this parameter, or by increasing the standard Bias values.
