diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-10-16 19:53:19 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-10-16 19:58:20 +0300 |
commit | 131ac2ec82b9e810dd6e0153009a71276b6d6f13 (patch) | |
tree | d96401e740a40d9caab5baa3b61092c2a908ea78 /source/blender/draw/engines/eevee/shaders/lights_lib.glsl | |
parent | 4ddf3215a7df3ac4a0cfceccb283414510078ba5 (diff) |
Fix T70249 EEVEE: Light bleeding on SSS translucency
This was caused by 2 things: Shadow map bias and aliasing.
It made the expected depth of the shadowmap further than the surface
itself in some cases. In normal time this leads to light leaking on normal
shadow mapping but here we need to always have the shadowmap depth above
the shading point.
To fix this, we use a 5 tap inflate filter using the minimum depth of all
5 samples. Using these 5 taps, we can deduce entrance surface derivatives
and there orientation towards the light ray. We use these derivatives to
bias the depth to avoid wrong depth at depth discontinuity in the shadowmap.
This bias can lead to some shadowleaks that are less distracting than the
lightleaks it fixes.
We also add a small bias to counteract the shadowmap depth precision.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lights_lib.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lights_lib.glsl | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl index b1c78cae54f..6427f02ed25 100644 --- a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl @@ -70,7 +70,6 @@ vec2 cubeFaceCoordEEVEE(vec3 P, float face, sampler2DArrayShadow tex) vec4 sample_cube(sampler2DArray tex, vec3 cubevec, float cube) { /* Manual Shadow Cube Layer indexing. */ - /* TODO Shadow Cube Array. */ float face = cubeFaceIndexEEVEE(cubevec); vec2 uv = cubeFaceCoordEEVEE(cubevec, face, tex); |