Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2021-03-08 19:16:46 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-03-08 19:25:38 +0300
commit1540f1df076ccd4fda224b7f56aa6ca0d2a9b1c2 (patch)
tree74b7277d9cf6ac049e479a883aead473942f46e4 /source/blender
parent0983e66e03001d9f38075d3a9ee8fcaa7966a7d2 (diff)
EEVEE: RenderPass: Improve AO pass if screen space radius is small
This just bypass the occlusion computation if there is no occlusion data. This avoids weird looking occlusion due to the screen space geometric normal reconstruction.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl
index 19ae0acc443..16b1a7ffeaa 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl
@@ -99,9 +99,12 @@ void main()
OcclusionData data = occlusion_load(vP, 1.0);
- float visibility = diffuse_occlusion(data, V, N, Ng);
-
- FragColor = vec4(visibility);
+ if (min_v4(abs(data.horizons)) != M_PI) {
+ FragColor = vec4(diffuse_occlusion(data, V, N, Ng));
+ }
+ else {
+ FragColor = vec4(1.0);
+ }
}
}