diff options
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | 8 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl | 15 |
2 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl index 8b232bf14a4..286f00783d9 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -548,6 +548,14 @@ float F_eta(float eta, float cos_theta) return result; } +/* Fresnel color blend base on fresnel factor */ +vec3 F_color_blend(float eta, float fresnel, vec3 f0_color) +{ + float f0 = F_eta(eta, 1.0); + float fac = saturate((fresnel - f0) / max(1e-8, 1.0 - f0)); + return mix(f0_color, vec3(1.0), fac); +} + /* Fresnel */ vec3 F_schlick(vec3 f0, float cos_theta) { 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..c2e45ebb879 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 |