diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-02-16 19:01:15 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-02-21 03:33:56 +0300 |
commit | 64d96f68d6ef0411383bb46d1a95d47769d927e5 (patch) | |
tree | 11630fe6451b696963ad8ede9565fa856f693bcb /source/blender/gpu/shaders | |
parent | 6c2e1f33983766ee5ee028e14a24e36c28d0a566 (diff) |
EEVEE: Ambient Occlusion: Refactor
- Fix noise/banding artifact on distant geometry.
- Fix overshadowing on un-occluded surfaces at grazing angle producing "fresnel"
like shadowing. Some of it still appears but this is caused to the low number
of horizons per pixel.
- Improve performance by using a fixed number of samples and fixing the
sampling area size. A better sampling pattern is planned to recover
the lost precision on large AO radius.
- Improved normal reconstruction for the AO pass.
- Improve Bent Normal reconstruction resulting in less faceted look on
smoothed geometry.
- Add Thickness heuristic to avoid overshadowing of thin objects.
Factor is currently hardcoded.
- Add bent normal support to Glossy reflections.
- Change Glossy occlusion to give less light leaks from lightprobes.
It can overshadow on smooth surface but this should be mitigated by
using SSR.
- Use Bent Normal for rough Glossy surfaces.
- Occlusion is now correctly evaluated for each BSDF. However this does make
everything slower. This is mitigated by the fact the search is a lot faster
than before.
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl index d718cc3f4fe..f3eea9869e5 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl @@ -4,7 +4,13 @@ void node_ambient_occlusion( { vec3 bent_normal; vec4 rand = texelfetch_noise_tex(gl_FragCoord.xy); - result_ao = occlusion_compute(normalize(normal), viewPosition, rand, bent_normal); + OcclusionData data = occlusion_load(viewPosition, 1.0); + + vec3 V = cameraVec; + vec3 N = normalize(normal); + vec3 Ng = safe_normalize(cross(dFdx(worldPosition), dFdy(worldPosition))); + + result_ao = diffuse_occlusion(data, V, N, Ng); result_color = result_ao * color; } #else |