Fix T65631 Eevee: Translucent shader broken in Eevee when AO is enabled

This commit is contained in:
Clément Foucault 2019-06-18 18:28:35 +02:00
parent f2651bc338
commit 82f569d75e
Notes: blender-bot 2023-02-14 08:07:50 +01:00
Referenced by issue #65631, Translucent shader broken in Eevee when AO is enabled
1 changed files with 3 additions and 1 deletions

View File

@ -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
/* ---------------------------- */