Fix T101965: Shadow bounds ignore the light Volume Factor
Take invsqrdist_volume into account for computing shadow bounds. Reviewed By: fclem Maniphest Tasks: T101965 Differential Revision: https://developer.blender.org/D16513
This commit is contained in:
parent
6a97668c9b
commit
8831c6f056
Notes:
blender-bot
2024-01-16 18:05:25 +01:00
Referenced by issue #101965, EEVEE - Lights stops casting shadows w/ sliders
|
@ -38,7 +38,7 @@ void EEVEE_shadows_cube_add(EEVEE_LightsInfo *linfo, EEVEE_Light *evli, Object *
|
|||
/* Saving light bounds for later. */
|
||||
BoundSphere *cube_bound = linfo->shadow_bounds + linfo->cube_len;
|
||||
copy_v3_v3(cube_bound->center, evli->position);
|
||||
cube_bound->radius = sqrt(1.0f / evli->invsqrdist);
|
||||
cube_bound->radius = sqrt(1.0f / min_ff(evli->invsqrdist, evli->invsqrdist_volume));
|
||||
|
||||
linfo->shadow_cube_light_indices[linfo->cube_len] = linfo->num_light;
|
||||
evli->shadow_id = linfo->shadow_len++;
|
||||
|
@ -87,7 +87,7 @@ bool EEVEE_shadows_cube_setup(EEVEE_LightsInfo *linfo, const EEVEE_Light *evli,
|
|||
|
||||
eevee_light_matrix_get(evli, cube_data->shadowmat);
|
||||
|
||||
shdw_data->far = max_ff(sqrt(1.0f / evli->invsqrdist), 3e-4);
|
||||
shdw_data->far = max_ff(sqrt(1.0f / min_ff(evli->invsqrdist, evli->invsqrdist_volume)), 3e-4);
|
||||
shdw_data->near = min_ff(shdw_data->near, shdw_data->far - 1e-4);
|
||||
|
||||
bool update = false;
|
||||
|
|
Loading…
Reference in New Issue