Cascaded shadow enhancements
Author: mvaligurskyCreated May 25, 2021Updated Sep 17, 2026
Labelsenhancementarea: graphics
Possible enhancements for cascaded shadow implementation:
- at the moment cascaded texture is square, and in case of 2, 3 or 4 cascades it's subdivided into quarters. For 2 cascades this leaves half the texture unused - we could allocate non-square texture instead and fix shader chunks to handle it.
- cross blending between cascades (currently a hard edge is visible). Can be implemented either by blended or a form of dithered transition. Dithering sounds like a good option, as we'd still sample just a single cascade. Done: https://github.com/playcanvas/engine/pull/7233
- when TAA is enabled, we should per frame randomize dithering, which TAA would then renoise
- fading out the last cascade instead of sharp line. Done: https://github.com/playcanvas/engine/pull/9417
- remove small meshes in distant cascades
- stop sampling shadow map past far distance (current implementation samples but ignores the result). Done: https://github.com/playcanvas/engine/pull/9419
- pancaking - clamp projected depth position to near clip plane to allow tighter range and improved precision
- current implementation is stable, which prefers stability (non-flickering) over the resolution. The resolution preferring solution could be optionally added.
- add additional frustum culling planes to further remove meshes that cannot cast into main camera frustum
Source: playcanvas/engine