playcanvas / playcanvas/engine
Cascaded shadow enhancements
Open
@mvaligursky is already working on this.
Since May 25, 2021.
area: graphics
enhancement
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.