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>2019-06-18 19:28:35 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-06-18 23:28:31 +0300
commit82f569d75e68a3e7e3f2435e17fa16e9a47376f4 (patch)
treee0dd9d6d0b39b85d38d4e3218779d1439bbb5163
parentf2651bc3383931b9cd2a5320873839be3342e020 (diff)
Fix T65631 Eevee: Translucent shader broken in Eevee when AO is enabled
-rw-r--r--source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
index e96667c0488..6b3d9ee4517 100644
--- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
@@ -441,8 +441,10 @@ void CLOSURE_NAME(vec3 N
/* Ambient Occlusion */
/* ---------------------------- */
#if defined(CLOSURE_GLOSSY) || defined(CLOSURE_DIFFUSE)
+ /* HACK: Fix for translucent BSDF. (see T65631) */
+ bool same_side = dot((gl_FrontFacing) ? worldNormal : -worldNormal, N) > 0.0;
vec3 bent_normal;
- float final_ao = occlusion_compute(N, viewPosition, ao, rand, bent_normal);
+ float final_ao = occlusion_compute(same_side ? N : -N, viewPosition, ao, rand, bent_normal);
#endif
/* ---------------------------- */