Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl23
1 files changed, 19 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 22194c22f39..c31fa166634 100644
--- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
@@ -54,6 +54,13 @@ uniform int hairThicknessRes = 1;
#define CLOSURE_SUBSURFACE
#endif /* SURFACE_PRINCIPLED */
+#if !defined(SURFACE_CLEARCOAT) && !defined(CLOSURE_NAME)
+ #define SURFACE_CLEARCOAT
+ #define CLOSURE_NAME eevee_closure_clearcoat
+ #define CLOSURE_GLOSSY
+ #define CLOSURE_CLEARCOAT
+#endif /* SURFACE_CLEARCOAT */
+
#if !defined(SURFACE_DIFFUSE) && !defined(CLOSURE_NAME)
#define SURFACE_DIFFUSE
#define CLOSURE_NAME eevee_closure_diffuse
@@ -67,6 +74,14 @@ uniform int hairThicknessRes = 1;
#define CLOSURE_SUBSURFACE
#endif /* SURFACE_SUBSURFACE */
+#if !defined(SURFACE_SKIN) && !defined(CLOSURE_NAME)
+ #define SURFACE_SKIN
+ #define CLOSURE_NAME eevee_closure_skin
+ #define CLOSURE_DIFFUSE
+ #define CLOSURE_SUBSURFACE
+ #define CLOSURE_GLOSSY
+#endif /* SURFACE_SKIN */
+
#if !defined(SURFACE_GLOSSY) && !defined(CLOSURE_NAME)
#define SURFACE_GLOSSY
#define CLOSURE_NAME eevee_closure_glossy
@@ -215,7 +230,7 @@ void CLOSURE_NAME(
#endif
#ifdef CLOSURE_CLEARCOAT
- out_spec_clear += l_color_vis * light_specular(ld, ltc_mat_clear, C_N, V, l_vector) * C_intensity * ld.l_spec;
+ out_spec_clear += l_color_vis * light_specular(ld, ltc_mat_clear, C_N, V, l_vector) * ld.l_spec;
#endif
}
@@ -226,8 +241,8 @@ void CLOSURE_NAME(
#ifdef CLOSURE_CLEARCOAT
vec3 brdf_lut_lamps_clear = texture(utilTex, vec3(lut_uv_clear, 1.0)).rgb;
- out_spec_clear *= F_area(f0, brdf_lut_lamps_clear.xy) * brdf_lut_lamps_clear.z;
- out_spec += out_spec_clear;
+ out_spec_clear *= F_area(vec3(0.04), brdf_lut_lamps_clear.xy) * brdf_lut_lamps_clear.z;
+ out_spec += out_spec_clear * C_intensity;
#endif
/* ---------------------------------------------------------------- */
@@ -417,7 +432,7 @@ void CLOSURE_NAME(
NV = dot(C_N, V);
vec2 C_uv = lut_coords(NV, C_roughness);
vec2 C_brdf_lut = texture(utilTex, vec3(C_uv, 1.0)).rg;
- vec3 C_fresnel = F_ibl(vec3(0.04), brdf_lut) * specular_occlusion(NV, final_ao, C_roughness);
+ vec3 C_fresnel = F_ibl(vec3(0.04), C_brdf_lut) * specular_occlusion(NV, final_ao, C_roughness);
out_spec += C_spec_accum.rgb * C_fresnel * C_intensity;
#endif