diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-04-05 00:51:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-04-05 15:05:01 +0300 |
commit | 50782df42586a5a038cad11530714371edaa5cd4 (patch) | |
tree | f2f6e3d5c4f07be85efd39e1319fdb49b76d1d2d /intern/cycles/render | |
parent | 3fa580866ef5514f6fa7f9c5a369249f69135c78 (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 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/scene.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/render/scene.h | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp index d3dfe1c5be6..38e8d9145dc 100644 --- a/intern/cycles/render/scene.cpp +++ b/intern/cycles/render/scene.cpp @@ -179,7 +179,7 @@ void Scene::free_memory(bool final) bake_manager->device_free(device, &dscene); - if (!params.persistent_data || final) + if (final) image_manager->device_free(device); else image_manager->device_free_builtin(device); diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h index 61c753e411c..3e7de203c54 100644 --- a/intern/cycles/render/scene.h +++ b/intern/cycles/render/scene.h @@ -178,7 +178,6 @@ class SceneParams { int num_bvh_time_steps; int hair_subdivisions; CurveShapeType hair_shape; - bool persistent_data; int texture_limit; bool background; @@ -193,7 +192,6 @@ class SceneParams { num_bvh_time_steps = 0; hair_subdivisions = 3; hair_shape = CURVE_RIBBON; - persistent_data = false; texture_limit = 0; background = true; } @@ -206,7 +204,7 @@ class SceneParams { use_bvh_unaligned_nodes == params.use_bvh_unaligned_nodes && num_bvh_time_steps == params.num_bvh_time_steps && hair_subdivisions == params.hair_subdivisions && hair_shape == params.hair_shape && - persistent_data == params.persistent_data && texture_limit == params.texture_limit); + texture_limit == params.texture_limit); } int curve_subdivisions() @@ -301,7 +299,7 @@ class Scene : public NodeOwner { * node array (e.g. Scene::geometry for Geometry nodes) and tag the appropriate * manager for an update. */ - template<typename T, typename... Args> T *create_node(Args &&... args) + template<typename T, typename... Args> T *create_node(Args &&...args) { T *node = new T(args...); node->set_owner(this); |