diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-01-04 12:41:34 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-01-04 12:43:54 +0300 |
commit | 205978a489276d2b9450be77cdfcb5f987830d06 (patch) | |
tree | cb5fe575fdba7a52d6f3ff6a8c193a4b951f910d /source/blender/draw/engines | |
parent | 4df11e3c70688ea3759793946d998bf2e8d55c45 (diff) |
Eevee: Fix AO applied twice on glossy shader when using OGL render
Seems to be a compiler bug. This is really strange.
I just rephrased the whole thing and it appears to work.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl | 10 |
1 files changed, 6 insertions, 4 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 6ecaf0a627b..6e89b7f0d08 100644 --- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl @@ -417,12 +417,14 @@ void CLOSURE_NAME( /* This factor is outputed to be used by SSR in order * to match the intensity of the regular reflections. */ ssr_spec = F_ibl(f0, brdf_lut); - if (!(ssrToggle && ssr_id == outputSsrId)) { - /* The SSR pass recompute the occlusion to not apply it to the SSR */ - ssr_spec *= specular_occlusion(NV, final_ao, roughness); + float spec_occlu = specular_occlusion(NV, final_ao, roughness); + + /* The SSR pass recompute the occlusion to not apply it to the SSR */ + if (ssrToggle && ssr_id == outputSsrId) { + spec_occlu = 1.0; } - out_spec += spec_accum.rgb * ssr_spec * float(specToggle); + out_spec += spec_accum.rgb * ssr_spec * spec_occlu * float(specToggle); #endif #ifdef CLOSURE_REFRACTION |