diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-11-23 05:39:06 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-11-24 08:37:37 +0300 |
commit | 16a28021493d5a54efff5e6aade39f7b015366cd (patch) | |
tree | 8b9961ea28db41ede2afd66bdc115a33246916a4 /source/blender/gpu | |
parent | f3b384862df83dfca8b7fbad3dc6c5c07d0cecaf (diff) |
Eevee: SSS: Principled Shader: Add a workaround the lack of scale input
This is a hack to make the user control the SSS radius even though the profile is baked with the default radius values.
This is completly against UI principles since you cannot edit the profile radiuses while there is something plugged into the radius socket.
Better solution will be to either have a dedicated node value for RGB radiuses and a SSS scale socket only for eevee.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 5d0ca35cc1f..c3345f51b4c 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2895,7 +2895,7 @@ void node_bsdf_principled_simple(vec4 base_color, float subsurface, vec3 subsurf void node_bsdf_principled_clearcoat(vec4 base_color, float subsurface, vec3 subsurface_radius, vec4 subsurface_color, float metallic, float specular, float specular_tint, float roughness, float anisotropic, float anisotropic_rotation, float sheen, float sheen_tint, float clearcoat, float clearcoat_roughness, float ior, float transmission, float transmission_roughness, vec3 N, vec3 CN, vec3 T, vec3 I, float ssr_id, - float sss_id, out Closure result) + float sss_id, vec3 sss_scale, out Closure result) { #ifdef EEVEE_ENGINE if (clearcoat == 0.0) { @@ -2953,10 +2953,10 @@ void node_bsdf_principled_clearcoat(vec4 base_color, float subsurface, vec3 subs #ifdef USE_SSS /* OPTI : Make irradiance computation shared with the diffuse. */ - result.sss_data.rgb = eevee_surface_translucent_lit(N, subsurface_color.rgb, 1.0); + result.sss_data.a = dot(sss_scale, vec3(1.0 / 3.0)); + result.sss_data.rgb = eevee_surface_translucent_lit(N, subsurface_color.rgb, result.sss_data.a); result.sss_data.rgb += eevee_surface_diffuse_lit(N, vec3(1.0), 1.0); result.sss_data.rgb *= mix(vec3(0.0), subsurface_color.rgb, subsurface); - result.sss_data.a = 1.0; /* TODO Find a parametrization */ #endif #endif |