EEVEE: Shadows: Fix incorrect shadowing near point lights source

This commit is contained in:
Clément Foucault 2019-09-06 23:06:58 +02:00
parent d288776cef
commit 44aaee573a
1 changed files with 1 additions and 1 deletions

View File

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