Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-01-17 02:23:31 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-01-17 02:23:31 +0300
commitc02d428147c970a61f69ccd15c49b5fb650454ec (patch)
tree7908852be513bab577b48b46e379b62da8dbf15e /source/blender/draw/engines
parentd7acabdef5a409e9c25395bc7919b9ea82ce0d8b (diff)
Eevee: Update lightprobes when deleting or linking a new world datablock
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c10
-rw-r--r--source/blender/draw/engines/eevee/eevee_private.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 73a513d5794..8bfff35c77d 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -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. */
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h
index 3c3b495f95c..d56d5abc9ef 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -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;