[Bf-blender-cvs] [44aaee573ad] master: EEVEE: Shadows: Fix incorrect shadowing near point lights source

Clément Foucault noreply at git.blender.org
Sat Sep 7 00:44:47 CEST 2019


Commit: 44aaee573adbd3dd7dc247d7c4dc0ea4011b8d0b
Author: Clément Foucault
Date:   Fri Sep 6 23:06:58 2019 +0200
Branches: master
https://developer.blender.org/rB44aaee573adbd3dd7dc247d7c4dc0ea4011b8d0b

EEVEE: Shadows: Fix incorrect shadowing near point lights source

===================================================================

M	source/blender/draw/engines/eevee/shaders/lights_lib.glsl

===================================================================

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. */



More information about the Bf-blender-cvs mailing list