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:
authorBrecht Van Lommel <brecht@blender.org>2021-04-05 00:51:24 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-04-05 15:05:01 +0300
commit50782df42586a5a038cad11530714371edaa5cd4 (patch)
treef2f6e3d5c4f07be85efd39e1319fdb49b76d1d2d /source/blender/makesrna
parent3fa580866ef5514f6fa7f9c5a369249f69135c78 (diff)
Render: faster animation and re-rendering with Persistent Data
For Cycles, when enabling the Persistent Data option, the full render data will be preserved from frame-to-frame in animation renders and between re-renders of the scene. This means that any modifier evaluation, BVH building, OpenGL vertex buffer uploads, etc, can be done only once for unchanged objects. This comes at an increased memory cost. Previously there option was named Persistent Images and had a more limited impact on render time and memory. When using multiple view layers, only data from a single view layer is preserved to keep memory usage somewhat under control. However objects shared between view layers are preserved, and so this can speedup such renders as well, even single frame renders. For Eevee and Workbench this option is not available, however these engines will now always reuse the depsgraph for animation and multiple view layers. This can significantly speed up rendering. These engines do not support sharing the depsgraph between re-renders, due to technical issues regarding OpenGL contexts. Support for this could be added if those are solved, see the code comments for details.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_render.c6
-rw-r--r--source/blender/makesrna/intern/rna_scene.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index 0411ef6d6ee..dd91a5509f5 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -298,13 +298,13 @@ static void rna_RenderEngine_unregister(Main *bmain, StructRNA *type)
return;
}
+ /* Stop all renders in case we were using this one. */
+ ED_render_engine_changed(bmain, false);
RE_FreeAllPersistentData();
+
RNA_struct_free_extension(type, &et->rna_ext);
RNA_struct_free(&BLENDER_RNA, type);
BLI_freelinkN(&R_engines, et);
-
- /* Stop all renders in case we were using this one. */
- ED_render_engine_changed(bmain, false);
}
static StructRNA *rna_RenderEngine_register(Main *bmain,
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 65643aa92d7..cc7747959a4 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1896,10 +1896,10 @@ static void rna_Scene_use_persistent_data_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
{
- Scene *sce = (Scene *)ptr->owner_id;
+ Scene *scene = (Scene *)ptr->owner_id;
- if (!(sce->r.mode & R_PERSISTENT_DATA)) {
- RE_FreePersistentData();
+ if (!(scene->r.mode & R_PERSISTENT_DATA)) {
+ RE_FreePersistentData(scene);
}
}
@@ -6606,8 +6606,10 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
/* persistent data */
prop = RNA_def_property(srna, "use_persistent_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_PERSISTENT_DATA);
- RNA_def_property_ui_text(
- prop, "Persistent Data", "Keep render data around for faster re-renders");
+ RNA_def_property_ui_text(prop,
+ "Persistent Data",
+ "Keep render data around for faster re-renders and animation renders, "
+ "at the cost of increased memory usage");
RNA_def_property_update(prop, 0, "rna_Scene_use_persistent_data_update");
/* Freestyle line thickness options */