diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-30 16:55:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-30 17:02:27 +0300 |
commit | f8b9f4e9bbc10675de9bbc3088f2841381e23f78 (patch) | |
tree | b03a144fc66280350a72fc856c69ff59dfc763bb /intern/cycles/render/tile.cpp | |
parent | ee364b63582c606977cc7dc54435d02fb9e1981c (diff) |
Cycles: Resumable render implementation for Cycles
This feature is also known by the name Samples Offset, which allows
artists to render animation with given amount of samples N, but then
render more samples, starting from N and ending with M (where M > N)
and merge renders together as if they rendered exactly M samples.
Surely such effect could be achieved by changing Seed variable, but
that has possible issues with correlation artifacts and requiring to
manually deal with per render layer samples and such.
While we can't support all possible renderfarm-related features in
Cycles it's nice to support really commonly used stuff.
Here's a command how to run Blender with the new feature enabled:
blender -- --cycles-resumable-num-chunks 24 --cycles-resumable-current-chunk 2
This command will divide samples range in 24 parts and render
range #2 (chunk number is 1-based).
This feature might be changed a bit after we'll do some tests here
in the studio with it.
Diffstat (limited to 'intern/cycles/render/tile.cpp')
-rw-r--r-- | intern/cycles/render/tile.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/intern/cycles/render/tile.cpp b/intern/cycles/render/tile.cpp index 3fb60735b65..3a6dfea11a7 100644 --- a/intern/cycles/render/tile.cpp +++ b/intern/cycles/render/tile.cpp @@ -97,6 +97,9 @@ TileManager::TileManager(bool progressive_, int num_samples_, int2 tile_size_, i preserve_tile_device = preserve_tile_device_; background = background_; + range_start_sample = 0; + range_num_samples = -1; + BufferParams buffer_params; reset(buffer_params, 0); } @@ -124,7 +127,7 @@ void TileManager::reset(BufferParams& params_, int num_samples_) num_samples = num_samples_; state.buffer = BufferParams(); - state.sample = -1; + state.sample = range_start_sample - 1; state.num_tiles = 0; state.num_rendered_tiles = 0; state.num_samples = 0; @@ -325,7 +328,11 @@ bool TileManager::next_tile(Tile& tile, int device) bool TileManager::done() { - return (state.sample+state.num_samples >= num_samples && state.resolution_divider == 1); + int end_sample = (range_num_samples == -1) + ? num_samples + : range_start_sample + range_num_samples; + return (state.resolution_divider == 1) && + (state.sample+state.num_samples >= end_sample); } bool TileManager::next() @@ -344,8 +351,10 @@ bool TileManager::next() if(progressive) state.num_samples = 1; - else + else if(range_num_samples == -1) state.num_samples = num_samples; + else + state.num_samples = range_num_samples; state.resolution_divider = 1; set_tiles(); @@ -354,5 +363,11 @@ bool TileManager::next() return true; } +int TileManager::get_num_effective_samples() +{ + return (range_num_samples == -1) ? num_samples + : range_num_samples; +} + CCL_NAMESPACE_END |