playcanvas / playcanvas/engine
Improve render-pass based SSAO
Open
@mvaligursky is already working on this.
Since Jun 4, 2024.
area: graphics
enhancement
performance
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
initial implementation: https://github.com/playcanvas/engine/pull/6657
possible improvements:
- currently the SSAO depends on the depth-prepass. This could be optional and depth-drab pass can be used instead to obtain the depth. https://github.com/playcanvas/engine/pull/9174
- when the SSAO uses the depth-pass, it runs before the main forward passes of the scene. This allows us to implement https://github.com/playcanvas/engine/issues/4844 properly.
- when SSAO is used together with TAA, randomize sampling using TAA's random values, to allow smaller number of SSAO samples to be used, and depending on TAA instaed of resolve them over few frames https://github.com/playcanvas/engine/pull/7139
- improve the shaders to use half precision to gain some performance.
- consider downscaling the depth buffer before the SSAO runs, or at least generate mipmaps from it. The SSAO shader we use allows sampling using mipmaps, to allow better quality larger size filter.
- if the center sample of ssao is on the far plane (or past some user configured distance), skipped the whole ray-marching part, assuming the skydome does not need AO.
- generate linear depth buffer before SSAO / depth-blur to improve performance. #7119
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.