Fix #114435: Harsh Principled BSDF Subsurface transition in EEVEE

Fixes a harsh transistion between diffuse and subsurface scattering
materials in the Principled BSDF as a user increases the Subsurface
Scattering Weight from 0 to 1.

Pull Request: https://projects.blender.org/blender/blender/pulls/114500
This commit is contained in:
Alaska
2023-11-06 17:25:14 +01:00
committed by Brecht Van Lommel
parent 46e291470f
commit f1116f64bd

View File

@@ -221,7 +221,8 @@ void node_bsdf_principled(vec4 base_color,
/* Diffuse component */
if (true) {
diffuse_data.sss_radius = max(subsurface_radius * subsurface_scale, vec3(0.0));
diffuse_data.sss_radius = subsurface_weight *
max(subsurface_radius * subsurface_scale, vec3(0.0));
diffuse_data.sss_id = uint(do_sss);
diffuse_data.color += weight * diffuse_sss_base_color.rgb * coat_tint.rgb;
}