[Bf-blender-cvs] [205978a4892] blender2.8: Eevee: Fix AO applied twice on glossy shader when using OGL render
Clément Foucault
noreply at git.blender.org
Thu Jan 4 10:53:48 CET 2018
Commit: 205978a489276d2b9450be77cdfcb5f987830d06
Author: Clément Foucault
Date: Thu Jan 4 10:41:34 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB205978a489276d2b9450be77cdfcb5f987830d06
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.
===================================================================
M source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
===================================================================
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
More information about the Bf-blender-cvs
mailing list