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
committerYimingWu <xp8110@outlook.com>2019-09-12 04:13:02 +0300
commita49481a93aa8b7681e117f984d357a09d158916f (patch)
treeaa9a84fa8cd7957b6bbced25005128059abe53f7
parentdb9428c9ae022880ef7f2e2f29748095d2f7b2d9 (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. */