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
This commit is contained in:
Sergey Sharybin 2021-11-24 15:52:50 +01:00
parent b41c72b710
commit 40d28b40df
1 changed files with 5 additions and 1 deletions

View File

@ -479,7 +479,11 @@ void PathTrace::set_denoiser_params(const DenoiseParams &params)
}
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)