Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Leeson <leesonw>2021-10-27 15:14:43 +0300
committerWilliam Leeson <william@blender.org>2021-10-27 15:21:15 +0300
commit82cf25dfbfad39a64b620c20bbd0d65915827a44 (patch)
tree33b2a3fe33da968cbc8a8172637177785c736fdc /intern/cycles/blender/sync.cpp
parent7b1c5712f888ea37bbccafd9ffd7a3a6a61e665f (diff)
Cycles: Scrambling distance for the PMJ sampler
Adds scrambling distance to the PMJ sampler. This is based on the work by Mathieu Menuet in D12318 who created the original implementation for the Sobol sampler. Reviewed By: brecht Maniphest Tasks: T92181 Differential Revision: https://developer.blender.org/D12854
Diffstat (limited to 'intern/cycles/blender/sync.cpp')
-rw-r--r--intern/cycles/blender/sync.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index f6f490077a7..e0a13625962 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender/sync.cpp
@@ -340,14 +340,16 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background)
cscene, "sampling_pattern", SAMPLING_NUM_PATTERNS, SAMPLING_PATTERN_SOBOL);
integrator->set_sampling_pattern(sampling_pattern);
+ bool use_adaptive_sampling = false;
if (preview) {
- integrator->set_use_adaptive_sampling(
- RNA_boolean_get(&cscene, "use_preview_adaptive_sampling"));
+ use_adaptive_sampling = RNA_boolean_get(&cscene, "use_preview_adaptive_sampling");
+ integrator->set_use_adaptive_sampling(use_adaptive_sampling);
integrator->set_adaptive_threshold(get_float(cscene, "preview_adaptive_threshold"));
integrator->set_adaptive_min_samples(get_int(cscene, "preview_adaptive_min_samples"));
}
else {
- integrator->set_use_adaptive_sampling(RNA_boolean_get(&cscene, "use_adaptive_sampling"));
+ use_adaptive_sampling = RNA_boolean_get(&cscene, "use_adaptive_sampling");
+ integrator->set_use_adaptive_sampling(use_adaptive_sampling);
integrator->set_adaptive_threshold(get_float(cscene, "adaptive_threshold"));
integrator->set_adaptive_min_samples(get_int(cscene, "adaptive_min_samples"));
}
@@ -361,7 +363,7 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background)
/* only use scrambling distance in the viewport if user wants to and disable with AS */
bool preview_scrambling_distance = get_boolean(cscene, "preview_scrambling_distance");
- if ((preview && !preview_scrambling_distance) || sampling_pattern != SAMPLING_PATTERN_SOBOL)
+ if ((preview && !preview_scrambling_distance) || use_adaptive_sampling)
scrambling_distance = 1.0f;
VLOG(1) << "Used Scrambling Distance: " << scrambling_distance;