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
path: root/source
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-11-25 19:47:32 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-11-25 19:47:52 +0300
commit9aece5e1e7748fa6020a3b6cbeabd17e1dc3bbaa (patch)
tree6c5c9796ddbdfc9855eb69e08f4ff50f8c699cb1 /source
parent0c4740735c5215a1e97ae8bb29cb74bcd472264e (diff)
Eevee: Fix Defered AO defines
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
index 8d5f11d76f2..5ec72833379 100644
--- a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
@@ -339,18 +339,13 @@ float gtao_multibounce(float visibility, vec3 albedo)
/* Use the right occlusion */
float occlusion_compute(vec3 N, vec3 vpos, float user_occlusion, vec2 randuv, out vec3 bent_normal)
{
- if ((int(aoSettings) & USE_AO) == 0) {
- bent_normal = N;
- return user_occlusion;
- }
- else {
+#ifndef USE_REFRACTION
+ if ((int(aoSettings) & USE_AO) > 0) {
float visibility;
vec3 vnor = mat3(ViewMatrix) * N;
#ifdef ENABLE_DEFERED_AO
-#ifndef USE_REFRACTION
gtao_deferred(vnor, vpos, gl_FragCoord.z, visibility, bent_normal);
-#endif
#else
gtao(vnor, vpos, randuv, visibility, bent_normal);
#endif
@@ -375,4 +370,8 @@ float occlusion_compute(vec3 N, vec3 vpos, float user_occlusion, vec2 randuv, ou
return min(visibility, user_occlusion);
}
+#endif
+
+ bent_normal = N;
+ return user_occlusion;
}