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-07-10 16:02:25 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-07-10 16:31:34 +0300
commit1a43e081873415754950766edaddad220adf67bc (patch)
tree6a4e61b2337606daf442973d9f82e1d56b906a98 /source/blender/editors/space_view3d
parent97f90d48a02eef89949532b166f57ea178ee5a87 (diff)
Eevee: LightCache: Initial Implementation
This separate probe rendering from viewport rendering, making possible to run the baking in another thread (non blocking and faster). The baked lighting is saved in the blend file. Nothing needs to be recomputed on load. There is a few missing bits / bugs: - Cache cannot be saved to disk as a separate file, it is saved in the DNA for now making file larger and memory usage higher. - Auto update only cubemaps does update the grids (bug). - Probes cannot be updated individually (considered as dynamic). - Light Cache cannot be (re)generated during render.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 83189159086..9aaced3e583 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -683,6 +683,18 @@ static void view3d_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
}
}
+static void view3d_lightcache_update(bContext *C)
+{
+ PointerRNA op_ptr;
+
+ WM_operator_properties_create(&op_ptr, "SCENE_OT_light_cache_bake");
+ RNA_int_set(&op_ptr, "delay", 200);
+ RNA_enum_set_identifier(C, &op_ptr, "subset", "DIRTY");
+
+ WM_operator_name_call(C, "SCENE_OT_light_cache_bake", WM_OP_INVOKE_DEFAULT, &op_ptr);
+
+ WM_operator_properties_free(&op_ptr);
+}
/* region dropbox definition */
static void view3d_dropboxes(void)
@@ -980,6 +992,9 @@ static void view3d_main_region_listener(
break;
}
break;
+ case NC_LIGHTPROBE:
+ ED_area_tag_refresh(sa);
+ break;
case NC_IMAGE:
/* this could be more fine grained checks if we had
* more context than just the region */
@@ -1409,6 +1424,13 @@ static void space_view3d_listener(
}
}
+static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(sa))
+{
+ /* This is only used by the auto lightprobe refresh for the moment.
+ * So we don't need to check anything to know what to do. */
+ view3d_lightcache_update((bContext *)C);
+}
+
const char *view3d_context_dir[] = {
"active_base", "active_object", NULL
};
@@ -1509,6 +1531,7 @@ void ED_spacetype_view3d(void)
st->free = view3d_free;
st->init = view3d_init;
st->listener = space_view3d_listener;
+ st->refresh = space_view3d_refresh;
st->duplicate = view3d_duplicate;
st->operatortypes = view3d_operatortypes;
st->keymap = view3d_keymap;