1
0
Fork 0

Merge pull request #100862 from Flarkk/fix_100850

Fix regression with shadows when light range is 0 or close
This commit is contained in:
Thaddeus Crews 2024-12-30 08:58:12 -06:00
commit 888883d608
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
1 changed files with 2 additions and 2 deletions

View File

@ -2510,7 +2510,7 @@ bool RendererSceneCull::_light_instance_update_shadow(Instance *p_instance, cons
}
real_t radius = RSG::light_storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_RANGE);
real_t z_near = 0.005f;
real_t z_near = MIN(0.005f, radius);
Projection cm;
cm.set_perspective(90, 1, z_near, radius);
@ -2600,7 +2600,7 @@ bool RendererSceneCull::_light_instance_update_shadow(Instance *p_instance, cons
real_t radius = RSG::light_storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_RANGE);
real_t angle = RSG::light_storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_SPOT_ANGLE);
real_t z_near = 0.005f;
real_t z_near = MIN(0.005f, radius);
Projection cm;
cm.set_perspective(angle * 2.0, 1.0, z_near, radius);