engine
engine copied to clipboard
Improve render-pass based SSAO
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.
- [x] 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
- [ ] 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.