Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-09-07 00:06:58 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-09-07 01:44:20 +0300
commit44aaee573adbd3dd7dc247d7c4dc0ea4011b8d0b (patch)
tree2a2f3a057214f2e749edc4d0f172b65d3020b36e
parentd288776cef7d69970f050800d3b230349fd08865 (diff)
EEVEE: Shadows: Fix incorrect shadowing near point lights source
-rw-r--r--source/blender/draw/engines/eevee/shaders/lights_lib.glsl2
1 files changed, 1 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 72017e971fc..b1c78cae54f 100644
--- a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl
@@ -92,7 +92,7 @@ float sample_cube_shadow(int shadow_id, vec3 W)
{
int data_id = int(sd(shadow_id).sh_data_index);
vec3 cubevec = transform_point(scube(data_id).shadowmat, W);
- float dist = max_v3(abs(cubevec)) - sd(shadow_id).sh_bias;
+ float dist = max(sd(shadow_id).sh_near, max_v3(abs(cubevec)) - sd(shadow_id).sh_bias);
dist = buffer_depth(true, dist, sd(shadow_id).sh_far, sd(shadow_id).sh_near);
/* Manual Shadow Cube Layer indexing. */
/* TODO Shadow Cube Array. */