[Bf-blender-cvs] [246ee82a2f3] blender2.8: Eevee: Some probe update changes.

Clément Foucault noreply at git.blender.org
Thu Jun 15 01:16:23 CEST 2017


Commit: 246ee82a2f3c7e076c711659d876909dc4b410ea
Author: Clément Foucault
Date:   Wed Jun 14 22:46:48 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB246ee82a2f3c7e076c711659d876909dc4b410ea

Eevee: Some probe update changes.

Dont render grids if cubemap count changes (because it does not depends on).
Recalc lighting if probe type change.

===================================================================

M	source/blender/draw/engines/eevee/eevee_lightprobes.c
M	source/blender/makesrna/intern/rna_lightprobe.c

===================================================================

diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 0a368229c83..b41b393b633 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -460,8 +460,6 @@ void EEVEE_lightprobes_cache_finish(EEVEE_SceneLayerData *sldata, EEVEE_PassList
 		e_data.update_world = true;
 		e_data.world_ready_to_shade = false;
 		pinfo->num_render_cube = 0;
-		pinfo->num_render_grid = 0;
-		pinfo->updated_bounce = 0;
 		pinfo->update_flag |= PROBE_UPDATE_CUBE;
 		pinfo->cache_num_cube = pinfo->num_cube;
 
@@ -470,12 +468,6 @@ void EEVEE_lightprobes_cache_finish(EEVEE_SceneLayerData *sldata, EEVEE_PassList
 			ped->need_update = true;
 			ped->ready_to_shade = false;
 		}
-
-		for (int i = 1; (ob = pinfo->probes_grid_ref[i]) && (i < MAX_PROBE); i++) {
-			EEVEE_LightProbeEngineData *ped = EEVEE_lightprobe_data_get(ob);
-			ped->need_update = true;
-			ped->updated_cells = 0;
-		}
 	}
 
 	DRWFboTexture tex_filter = {&sldata->probe_pool, DRW_TEX_RGBA_16, DRW_TEX_FILTER | DRW_TEX_MIPMAP};
@@ -493,10 +485,25 @@ void EEVEE_lightprobes_cache_finish(EEVEE_SceneLayerData *sldata, EEVEE_PassList
 	if (!sldata->irradiance_pool) {
 		sldata->irradiance_pool = DRW_texture_create_2D(IRRADIANCE_POOL_SIZE, IRRADIANCE_POOL_SIZE, irradiance_format, DRW_TEX_FILTER, NULL);
 		pinfo->num_render_grid = 0;
+		pinfo->updated_bounce = 0;
+
+		for (int i = 1; (ob = pinfo->probes_grid_ref[i]) && (i < MAX_PROBE); i++) {
+			EEVEE_LightProbeEngineData *ped = EEVEE_lightprobe_data_get(ob);
+			ped->need_update = true;
+			ped->updated_cells = 0;
+		}
 	}
 
 	if (!sldata->irradiance_rt) {
 		sldata->irradiance_rt = DRW_texture_create_2D(IRRADIANCE_POOL_SIZE, IRRADIANCE_POOL_SIZE, irradiance_format, DRW_TEX_FILTER, NULL);
+		pinfo->num_render_grid = 0;
+		pinfo->updated_bounce = 0;
+
+		for (int i = 1; (ob = pinfo->probes_grid_ref[i]) && (i < MAX_PROBE); i++) {
+			EEVEE_LightProbeEngineData *ped = EEVEE_lightprobe_data_get(ob);
+			ped->need_update = true;
+			ped->updated_cells = 0;
+		}
 	}
 
 	EEVEE_lightprobes_updates(sldata, psl);
diff --git a/source/blender/makesrna/intern/rna_lightprobe.c b/source/blender/makesrna/intern/rna_lightprobe.c
index 4003cce3da5..3fb9daafce2 100644
--- a/source/blender/makesrna/intern/rna_lightprobe.c
+++ b/source/blender/makesrna/intern/rna_lightprobe.c
@@ -82,7 +82,7 @@ static void rna_def_lightprobe(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_items(prop, lightprobe_type_items);
 	RNA_def_property_ui_text(prop, "Type", "Type of probe");
-	RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, NULL);
+	RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
 
 	prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "clipsta");




More information about the Bf-blender-cvs mailing list