Merge pull request #26125 from JFonS/revert_light_vec_shadows

Revert back to ignoring LIGHT_VEC for 2D shadows
This commit is contained in:
Rémi Verschelde 2019-02-21 18:49:14 +01:00 committed by GitHub
commit a01dca79e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -440,6 +440,10 @@ FRAGMENT_SHADER_CODE
color *= light; color *= light;
#ifdef USE_SHADOWS #ifdef USE_SHADOWS
// Reset light_vec to compute shadows, the shadow map is created from the light origin, so it only
// makes sense to compute shadows from there.
light_vec = light_uv_interp.zw;
float angle_to_light = -atan(light_vec.x, light_vec.y); float angle_to_light = -atan(light_vec.x, light_vec.y);
float PI = 3.14159265358979323846264; float PI = 3.14159265358979323846264;
/*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays /*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays

View file

@ -549,6 +549,10 @@ FRAGMENT_SHADER_CODE
color *= light; color *= light;
#ifdef USE_SHADOWS #ifdef USE_SHADOWS
// Reset light_vec to compute shadows, the shadow map is created from the light origin, so it only
// makes sense to compute shadows from there.
light_vec = light_uv_interp.zw;
float angle_to_light = -atan(light_vec.x, light_vec.y); float angle_to_light = -atan(light_vec.x, light_vec.y);
float PI = 3.14159265358979323846264; float PI = 3.14159265358979323846264;
/*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays /*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays