[Bf-blender-cvs] [9f6313498a0] master: Fix missing samples count pass when using tiles

Sergey Sharybin noreply at git.blender.org
Wed Sep 22 15:08:05 CEST 2021


Commit: 9f6313498a0af386f08ed17c83bf33b8c2c3b5b3
Author: Sergey Sharybin
Date:   Wed Sep 22 13:05:09 2021 +0200
Branches: master
https://developer.blender.org/rB9f6313498a0af386f08ed17c83bf33b8c2c3b5b3

Fix missing samples count pass when using tiles

Samples count pass is normalized to the overall number of samples.
This means that we need to store actual value of the samples in the
tile buffer file.

A bit annoying to pull all those settings to BufferParams and need
to find a more generic solution, but for now this is easiest and a
quickest solution.

Differential Revision: https://developer.blender.org/D12597

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

M	intern/cycles/integrator/path_trace.cpp
M	intern/cycles/render/buffers.cpp
M	intern/cycles/render/buffers.h
M	intern/cycles/render/session.cpp

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

diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp
index bc43747718d..b62a06aea43 100644
--- a/intern/cycles/integrator/path_trace.cpp
+++ b/intern/cycles/integrator/path_trace.cpp
@@ -933,10 +933,7 @@ void PathTrace::process_full_buffer_from_disk(string_view filename)
 int PathTrace::get_num_render_tile_samples() const
 {
   if (full_frame_state_.render_buffers) {
-    /* If the full-frame buffer is read from disk the number of samples is not used as there is a
-     * sample count pass for that in the buffer. Just avoid access to badly defined state of the
-     * path state. */
-    return 0;
+    return full_frame_state_.render_buffers->params.samples;
   }
 
   return render_scheduler_.get_num_rendered_samples();
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp
index 186699596ac..1882510cd70 100644
--- a/intern/cycles/render/buffers.cpp
+++ b/intern/cycles/render/buffers.cpp
@@ -105,6 +105,7 @@ NODE_DEFINE(BufferParams)
 
   SOCKET_STRING(layer, "Layer", ustring());
   SOCKET_STRING(view, "View", ustring());
+  SOCKET_INT(samples, "Samples", 0);
   SOCKET_FLOAT(exposure, "Exposure", 1.0f);
   SOCKET_BOOLEAN(use_approximate_shadow_catcher, "Use Approximate Shadow Catcher", false);
   SOCKET_BOOLEAN(use_transparent_background, "Transparent Background", false);
diff --git a/intern/cycles/render/buffers.h b/intern/cycles/render/buffers.h
index a07e7289566..184ac7197af 100644
--- a/intern/cycles/render/buffers.h
+++ b/intern/cycles/render/buffers.h
@@ -98,6 +98,7 @@ class BufferParams : public Node {
   vector<BufferPass> passes;
   ustring layer;
   ustring view;
+  int samples = 0;
   float exposure = 1.0f;
   bool use_approximate_shadow_catcher = false;
   bool use_transparent_background = false;
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index c39232be2b0..47eeffd97fe 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -407,6 +407,7 @@ void Session::do_delayed_reset()
   buffer_params_ = delayed_reset_.buffer_params;
 
   /* Store parameters used for buffers access outside of scene graph.  */
+  buffer_params_.samples = params.samples;
   buffer_params_.exposure = scene->film->get_exposure();
   buffer_params_.use_approximate_shadow_catcher =
       scene->film->get_use_approximate_shadow_catcher();



More information about the Bf-blender-cvs mailing list