From 6a1cc0d8559401199966edf3423393857fd77250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Foucault?= Date: Mon, 20 Jun 2022 16:31:22 +0200 Subject: Fix T99019 EEVEE: Regression: Specular BSDF does not apply occlusion Since the occlusion input is going to be removed in EEVEE-Next, I just added a temporary workaround. The occlusion is passed as SSS radius as the Specular BSDF does not use it. The final result matches 3.1 release --- .../blender/draw/engines/eevee/shaders/closure_eval_surface_lib.glsl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/draw/engines/eevee') diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_surface_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_surface_lib.glsl index 0f5290a7c07..ffca97b6b8f 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_eval_surface_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_eval_surface_lib.glsl @@ -181,6 +181,8 @@ Closure closure_eval(ClosureDiffuse diffuse, ClosureReflection reflection) /* Glue with the old system. */ CLOSURE_VARS_DECLARE_2(Diffuse, Glossy); + /* WORKAROUND: This is to avoid regression in 3.2 and avoid messing with EEVEE-Next. */ + in_common.occlusion = (diffuse.sss_radius.g == -1.0) ? diffuse.sss_radius.r : 1.0; in_Diffuse_0.N = diffuse.N; in_Diffuse_0.albedo = diffuse.color; in_Glossy_1.N = reflection.N; @@ -207,6 +209,8 @@ Closure closure_eval(ClosureDiffuse diffuse, /* Glue with the old system. */ CLOSURE_VARS_DECLARE_3(Diffuse, Glossy, Glossy); + /* WORKAROUND: This is to avoid regression in 3.2 and avoid messing with EEVEE-Next. */ + in_common.occlusion = (diffuse.sss_radius.g == -1.0) ? diffuse.sss_radius.r : 1.0; in_Diffuse_0.N = diffuse.N; in_Diffuse_0.albedo = diffuse.color; in_Glossy_1.N = reflection.N; -- cgit v1.2.3