diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-04-30 15:07:16 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-04-30 15:07:22 +0300 |
commit | 2445d5abc269123cb0789cc16a5710c6577e9d20 (patch) | |
tree | 3742191b131f67ec11283ebebd1dcec174d2cc39 /source | |
parent | d1f6ea2793d2b756b4f903f3ee7d09a90cf11890 (diff) |
Fix T63393 Eevee: Specular Shader's Clear Coat does not function
Diffstat (limited to 'source')
3 files changed, 21 insertions, 9 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index ecfb601d00a..ae145546856 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -591,6 +591,7 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, datatoc_lit_surface_frag_glsl, datatoc_lit_surface_frag_glsl, datatoc_lit_surface_frag_glsl, + datatoc_lit_surface_frag_glsl, datatoc_volumetric_lib_glsl); e_data.volume_shader_lib = BLI_string_joinN(datatoc_common_view_lib_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 7dba3738c12..c8b57c5dec2 100644 --- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl @@ -44,6 +44,14 @@ uniform int hairThicknessRes = 1; #define CLOSURE_GLOSSY #endif /* SURFACE_DEFAULT */ +#if !defined(SURFACE_DEFAULT_CLEARCOAT) && !defined(CLOSURE_NAME) +#define SURFACE_DEFAULT_CLEARCOAT +#define CLOSURE_NAME eevee_closure_default_clearcoat +#define CLOSURE_DIFFUSE +#define CLOSURE_GLOSSY +#define CLOSURE_CLEARCOAT +#endif /* SURFACE_DEFAULT_CLEARCOAT */ + #if !defined(SURFACE_PRINCIPLED) && !defined(CLOSURE_NAME) #define SURFACE_PRINCIPLED #define CLOSURE_NAME eevee_closure_principled diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 36c4138cefd..c64623eeaf7 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -3428,15 +3428,18 @@ void node_eevee_specular(vec4 diffuse, out Closure result) { vec3 out_diff, out_spec, ssr_spec; - eevee_closure_default(normal, - diffuse.rgb, - specular.rgb, - int(ssr_id), - roughness, - occlusion, - out_diff, - out_spec, - ssr_spec); + eevee_closure_default_clearcoat(normal, + diffuse.rgb, + specular.rgb, + int(ssr_id), + roughness, + clearcoat_normal, + clearcoat * 0.25, + clearcoat_roughness, + occlusion, + out_diff, + out_spec, + ssr_spec); vec3 vN = normalize(mat3(ViewMatrix) * normal); result = CLOSURE_DEFAULT; |