From 40d28b40dfd0b0093263947f66fc1760abd55ad6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 24 Nov 2021 15:52:50 +0100 Subject: Fix black Cycles result when cancelling tiled rendering with shadow catcher Noticed when was looking into T93155. Steps to reproduce: - Open the .blend file from the report - Hit F12 to start rendering - After some tiles were rendered hit Esc The issue is caused by "sticky" cancel reported via Progress. This means that once user hit Esc all further requests for cancel state will return truth, which was preventing OIDN denoiser from completing the denoising task. Now only allow stopping the denoiser when interactive rendering requests a very fast stopping. Aiming the fix for 3.0 branch. Differential Revision: https://developer.blender.org/D13352 --- intern/cycles/integrator/path_trace.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'intern/cycles/integrator') diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp index 92bf8e69d19..f2fd5b1b028 100644 --- a/intern/cycles/integrator/path_trace.cpp +++ b/intern/cycles/integrator/path_trace.cpp @@ -479,7 +479,11 @@ void PathTrace::set_denoiser_params(const DenoiseParams ¶ms) } denoiser_ = Denoiser::create(device_, params); - denoiser_->is_cancelled_cb = [this]() { return is_cancel_requested(); }; + + /* Only take into account the "immediate" cancel to have interactive rendering responding to + * navigation as quickly as possible, but allow to run denoiser after user hit Esc button while + * doing offline rendering. */ + denoiser_->is_cancelled_cb = [this]() { return render_cancel_.is_requested; }; } void PathTrace::set_adaptive_sampling(const AdaptiveSampling &adaptive_sampling) -- cgit v1.2.3