diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-11-25 19:39:21 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-11-25 19:47:52 +0300 |
commit | 5dfeecf47b575e54fddd3e915024b721efd29eb6 (patch) | |
tree | c8178d2c50b600f0d120cef65107d4ec607a471a /source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | |
parent | 974ffaa39d8dd9f0bdd7bbf74648183b1937d3be (diff) |
Eevee: Add SSS support in probes
Previously the lighting of SSS material was not present in reflection probe or irradiance grid.
This does not compute the SSS correctly but at least output the corresponding irradiance power to the correct output.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | 11 |
1 files changed, 11 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 54825303b5d..f02812e3e6e 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -656,6 +656,8 @@ Closure closure_add(Closure cl1, Closure cl2) return cl; } +uniform bool sssToggle; + #if defined(MESH_SHADER) && !defined(USE_ALPHA_HASH) && !defined(USE_ALPHA_CLIP) && !defined(SHADOW_SHADER) && !defined(USE_MULTIPLY) layout(location = 0) out vec4 fragColor; #ifdef USE_SSS @@ -702,6 +704,15 @@ void main() sssAlbedo = cl.sss_albedo.rgbb; #endif #endif + + /* For Probe capture */ +#ifdef USE_SSS +#ifdef USE_SSS_ALBEDO + fragColor.rgb += cl.sss_data.rgb * cl.sss_albedo.rgb * float(!sssToggle); +#else + fragColor.rgb += cl.sss_data.rgb * float(!sssToggle); +#endif +#endif } #endif /* MESH_SHADER && !SHADOW_SHADER */ |