From 35d3b6316b21ad9ae7eb96a7a541c4051eae3441 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 19 Jan 2015 18:13:26 +0100 Subject: D627: Memory usage optimization for the compositor. The compostor used a fixed size of 4 floats to hold pixel data. this patch will select size of a pixel based on its type. It uses 1 float for Value, 3 float for vector and 4 floats for color data types. When benchmarking on shots (opening shot of caminandes) we get a reduction of memory of 30% and a tiny speedup as less data transformations needs to take place (but these are negligable. More information of the patch can be found on https://developer.blender.org/D627 and http://wiki.blender.org/index.php/Dev:Ref/Proposals/Compositor2014_p1.1_TD Developers: jbakker & mdewanchand Thanks for Sergey for his indept review. --- source/blender/compositor/intern/COM_ExecutionSystem.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source/blender/compositor/intern/COM_ExecutionSystem.cpp') diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 7c08188db90..0667271f4b1 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -137,11 +137,15 @@ void ExecutionSystem::execute() } unsigned int index; + // First allocale all write buffer for (index = 0; index < this->m_operations.size(); index++) { NodeOperation *operation = this->m_operations[index]; - operation->setbNodeTree(this->m_context.getbNodeTree()); - operation->initExecution(); + if (operation->isWriteBufferOperation()) { + operation->setbNodeTree(this->m_context.getbNodeTree()); + operation->initExecution(); + } } + // Connect read buffers to their write buffers for (index = 0; index < this->m_operations.size(); index++) { NodeOperation *operation = this->m_operations[index]; if (operation->isReadBufferOperation()) { @@ -149,6 +153,14 @@ void ExecutionSystem::execute() readOperation->updateMemoryBuffer(); } } + // initialize other operations + for (index = 0; index < this->m_operations.size(); index++) { + NodeOperation *operation = this->m_operations[index]; + if (!operation->isWriteBufferOperation()) { + operation->setbNodeTree(this->m_context.getbNodeTree()); + operation->initExecution(); + } + } for (index = 0; index < this->m_groups.size(); index++) { ExecutionGroup *executionGroup = this->m_groups[index]; executionGroup->setChunksize(this->m_context.getChunksize()); -- cgit v1.2.3 From 408a2a8420c9d918236194007c01e1d3b3ebe13c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 27 Mar 2015 14:38:02 +0500 Subject: Compositor: Improve reports to the interface about what's going on The functionality was got lost when new compositor system was landed and it wasn't always clear what's causing the hicucps. Now it's nicely reported to the stats line. --- source/blender/compositor/intern/COM_ExecutionSystem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/compositor/intern/COM_ExecutionSystem.cpp') diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 0667271f4b1..1f8b7654786 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -76,6 +76,8 @@ ExecutionSystem::ExecutionSystem(RenderData *rd, Scene *scene, bNodeTree *editin viewer_border->xmin < viewer_border->xmax && viewer_border->ymin < viewer_border->ymax; + editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Determining resolution"); + for (index = 0; index < this->m_groups.size(); index++) { resolution[0] = 0; resolution[1] = 0; @@ -124,6 +126,9 @@ void ExecutionSystem::set_operations(const Operations &operations, const Groups void ExecutionSystem::execute() { + const bNodeTree *editingtree = this->m_context.getbNodeTree(); + editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Initializing execution"); + DebugInfo::execute_started(this); unsigned int order = 0; @@ -178,6 +183,7 @@ void ExecutionSystem::execute() WorkScheduler::finish(); WorkScheduler::stop(); + editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Deinitializing execution"); for (index = 0; index < this->m_operations.size(); index++) { NodeOperation *operation = this->m_operations[index]; operation->deinitExecution(); -- cgit v1.2.3 From 59b578e320313958be69400f34fe3d0dd2ae865c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 28 Mar 2015 02:36:00 +1100 Subject: Cleanup: use const char for stats arg --- source/blender/compositor/intern/COM_ExecutionSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/compositor/intern/COM_ExecutionSystem.cpp') diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 1f8b7654786..0466fbedb0a 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -76,7 +76,7 @@ ExecutionSystem::ExecutionSystem(RenderData *rd, Scene *scene, bNodeTree *editin viewer_border->xmin < viewer_border->xmax && viewer_border->ymin < viewer_border->ymax; - editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Determining resolution"); + editingtree->stats_draw(editingtree->sdh, "Compositing | Determining resolution"); for (index = 0; index < this->m_groups.size(); index++) { resolution[0] = 0; -- cgit v1.2.3 From 77667ad80f39e608d625ddae07914a9f42a4ed86 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 2 Apr 2015 15:55:43 +1100 Subject: Cleanup --- source/blender/compositor/intern/COM_ExecutionSystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/compositor/intern/COM_ExecutionSystem.cpp') diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 0466fbedb0a..2ed9e6187ba 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -127,7 +127,7 @@ void ExecutionSystem::set_operations(const Operations &operations, const Groups void ExecutionSystem::execute() { const bNodeTree *editingtree = this->m_context.getbNodeTree(); - editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Initializing execution"); + editingtree->stats_draw(editingtree->sdh, (char *)"Compositing | Initializing execution"); DebugInfo::execute_started(this); @@ -183,7 +183,7 @@ void ExecutionSystem::execute() WorkScheduler::finish(); WorkScheduler::stop(); - editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Deinitializing execution"); + editingtree->stats_draw(editingtree->sdh, (char *)"Compositing | Deinitializing execution"); for (index = 0; index < this->m_operations.size(); index++) { NodeOperation *operation = this->m_operations[index]; operation->deinitExecution(); -- cgit v1.2.3 From d5f1b9c2223333e03f2e4994171ad9df8c1c4f21 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 6 Apr 2015 10:40:12 -0300 Subject: Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo --- source/blender/compositor/intern/COM_ExecutionSystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/compositor/intern/COM_ExecutionSystem.cpp') diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 2ed9e6187ba..caeaa07d9f9 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -43,8 +43,10 @@ extern "C" { #endif ExecutionSystem::ExecutionSystem(RenderData *rd, Scene *scene, bNodeTree *editingtree, bool rendering, bool fastcalculation, - const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings) + const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings, + const char *viewName) { + this->m_context.setViewName(viewName); this->m_context.setScene(scene); this->m_context.setbNodeTree(editingtree); this->m_context.setPreviewHash(editingtree->previews); -- cgit v1.2.3