Eevee: Update lightprobes when deleting or linking a new world datablock

This commit is contained in:
2018-01-17 00:23:31 +01:00
parent d7acabdef5
commit c02d428147
2 changed files with 10 additions and 1 deletions

View File

@@ -374,7 +374,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
float *col = ts.colorBackground;
if (wo) {
col = &wo->horr;
if (wo->update_flag != 0) {
if (wo->update_flag != 0 || pinfo->prev_world != wo) {
e_data.update_world |= PROBE_UPDATE_ALL;
pinfo->updated_bounce = 0;
pinfo->grid_initialized = false;
@@ -396,6 +396,14 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
col = pink;
}
}
pinfo->prev_world = wo;
}
else if (pinfo->prev_world) {
pinfo->prev_world = NULL;
e_data.update_world |= PROBE_UPDATE_ALL;
pinfo->updated_bounce = 0;
pinfo->grid_initialized = false;
}
/* Fallback if shader fails or if not using nodetree. */

View File

@@ -439,6 +439,7 @@ typedef struct EEVEE_LightProbesInfo {
int target_size;
int irradiance_vis_size;
int grid_initialized;
struct World *prev_world;
/* Actual number of probes that have datas. */
int num_render_cube;
int num_render_grid;