Eevee: Irradiance Grid: Fix problem with bounce update.

Before this patch, if one of the grid was updated (moved) only the subsequents evaluated grids had their level reset and had all their bounces recomputed.
This commit is contained in:
Clément Foucault 2017-12-02 00:59:58 +01:00
parent eb605c2c2b
commit d439e87064
1 changed files with 7 additions and 0 deletions

View File

@ -694,6 +694,13 @@ static void EEVEE_lightprobes_updates(EEVEE_ViewLayerData *sldata, EEVEE_PassLis
EEVEE_LightGrid *egrid = &pinfo->grid_data[i];
EEVEE_LightProbeEngineData *ped = EEVEE_lightprobe_data_ensure(ob);
/* If one grid has move we need to recompute all the lighting. */
if (!pinfo->grid_initialized) {
ped->updated_cells = 0;
ped->updated_lvl = 0;
ped->need_update = true;
}
/* Add one for level 0 */
ped->max_lvl = 1.0f + floorf(log2f((float)MAX3(probe->grid_resolution_x,
probe->grid_resolution_y,