From c63e735f6b601e662fbb1ed5d7a71293552d6720 Mon Sep 17 00:00:00 2001 From: Andrii Date: Thu, 11 Nov 2021 08:57:35 +0100 Subject: Cycles: Add sample offset option This patch exposes the sampling offset option to Blender. It is located in the "Sampling > Advanced" panel. For example, this can be useful to parallelize rendering and distribute different chunks of samples for each computer to render. --- I also had to add this option to `RenderWork` and `RenderScheduler` classes so that the sample count in the status string can be calculated correctly. Reviewed By: leesonw Differential Revision: https://developer.blender.org/D13086 --- intern/cycles/session/session.cpp | 3 ++- intern/cycles/session/session.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'intern/cycles/session') diff --git a/intern/cycles/session/session.cpp b/intern/cycles/session/session.cpp index b228939689c..299d731d9f9 100644 --- a/intern/cycles/session/session.cpp +++ b/intern/cycles/session/session.cpp @@ -262,6 +262,7 @@ RenderWork Session::run_update_for_next_iteration() } render_scheduler_.set_num_samples(params.samples); + render_scheduler_.set_start_sample(params.sample_offset); render_scheduler_.set_time_limit(params.time_limit); while (have_tiles) { @@ -397,7 +398,7 @@ void Session::do_delayed_reset() /* Tile and work scheduling. */ tile_manager_.reset_scheduling(buffer_params_, get_effective_tile_size()); - render_scheduler_.reset(buffer_params_, params.samples); + render_scheduler_.reset(buffer_params_, params.samples, params.sample_offset); /* Passes. */ /* When multiple tiles are used SAMPLE_COUNT pass is used to keep track of possible partial diff --git a/intern/cycles/session/session.h b/intern/cycles/session/session.h index 1ec0c6e9bb1..3f73593f008 100644 --- a/intern/cycles/session/session.h +++ b/intern/cycles/session/session.h @@ -54,6 +54,7 @@ class SessionParams { bool experimental; int samples; + int sample_offset; int pixel_size; int threads; @@ -75,6 +76,7 @@ class SessionParams { experimental = false; samples = 1024; + sample_offset = 0; pixel_size = 1; threads = 0; time_limit = 0.0; -- cgit v1.2.3