Open
Description
openedon Jun 18, 2023
SSAO got merged in #7402, but there's still a lot we can do better.
Performance
- Faster depth->world position (see reverted code)
- Render at half resolution and use a bilateral upsample
- F16 math (missing naga-wgsl support [meta] f16 support gfx-rs/wgpu#4384)
- Faster depth mipchain creation (https://github.com/GPUOpen-Effects/FidelityFX-SPD) (wgpu/naga does not currently support subgroup ops)
Quality
- Replace the spatial denoiser with a combined spatial+temporal denoiser, similar to bevy_solari's
- Try interleaved gradient noise or tellusim's spatiotemporal blue noise for sampling
- Bent normals
- Better multibounce approximation (https://drive.google.com/file/d/1SyagcEVplIm2KkRD3WQYSO9O0Iyi1hfy/view)
- Configurable parameters/heuristics
Platform Support
- SSAO currently does not work on DirectX12 due to issues with wgpu and naga:
- DX12 increase
max_storage_buffers_per_shader_stage
andmax_storage_textures_per_shader_stage
gfx-rs/wgpu#3798 - Implement Pack/Unpack for HLSL gfx-rs/naga#2353 (we have a work-around for this issue in the SSAO shaders atm)
- DX12 increase
- SSAO currently does not work on WebGPU because r16float is not a valid storage texture format https://gpuweb.github.io/gpuweb/wgsl/#storage-texel-formats. We can fix this with a fallback to r32float.
Recent Algorithm Advancements
- Visibility bitmask (https://cdrinmatane.github.io/posts/ssaovb-code/, https://link.springer.com/article/10.1007/s00371-022-02703-y, https://cdrinmatane.github.io/posts/cgspotlight-slides/)
- Screen space diffuse lighting (https://github.com/Patapom/GodComplex/blob/master/Tests/TestHBIL/2018%20Mayaux%20-%20Horizon-Based%20Indirect%20Lighting%20(HBIL).pdf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment