diff options
author | Patrick Mours <pmours@nvidia.com> | 2019-12-11 20:11:46 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2020-01-08 18:53:11 +0300 |
commit | d5ca72191c36f3022db8fa5a17d933ee82c82d30 (patch) | |
tree | 8708d0e1d793d8aa6275dfafaae075f3192a28c5 /intern/cycles/render/buffers.cpp | |
parent | f1516e007d9c9f72218c3256eaa1b478a6c25052 (diff) |
Cycles: Add OptiX AI denoiser support
This patch adds support for the OptiX denoiser as an alternative to the existing NLM denoiser in Cycles. It's re-using the same denoising architecture based on tiles and therefore implicitly also works with multiple GPUs.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D6395
Diffstat (limited to 'intern/cycles/render/buffers.cpp')
-rw-r--r-- | intern/cycles/render/buffers.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp index fe8606e1939..50308d0d377 100644 --- a/intern/cycles/render/buffers.cpp +++ b/intern/cycles/render/buffers.cpp @@ -55,7 +55,10 @@ bool BufferParams::modified(const BufferParams ¶ms) { return !(full_x == params.full_x && full_y == params.full_y && width == params.width && height == params.height && full_width == params.full_width && - full_height == params.full_height && Pass::equals(passes, params.passes)); + full_height == params.full_height && Pass::equals(passes, params.passes) && + denoising_data_pass == params.denoising_data_pass && + denoising_clean_pass == params.denoising_clean_pass && + denoising_prefiltered_pass == params.denoising_prefiltered_pass); } int BufferParams::get_passes_size() @@ -183,13 +186,28 @@ bool RenderBuffers::get_denoising_pass_rect( offset = type + params.get_denoising_offset(); scale /= sample; } - else if (type == DENOISING_PASS_PREFILTERED_COLOR && !params.denoising_prefiltered_pass) { - /* If we're not saving the prefiltering result, return the original noisy pass. */ - offset = params.get_denoising_offset() + DENOISING_PASS_COLOR; - scale /= sample; + else if (params.denoising_prefiltered_pass) { + offset = type + params.get_denoising_prefiltered_offset(); } else { - offset = type + params.get_denoising_prefiltered_offset(); + switch (type) { + case DENOISING_PASS_PREFILTERED_DEPTH: + offset = params.get_denoising_offset() + DENOISING_PASS_DEPTH; + break; + case DENOISING_PASS_PREFILTERED_NORMAL: + offset = params.get_denoising_offset() + DENOISING_PASS_NORMAL; + break; + case DENOISING_PASS_PREFILTERED_ALBEDO: + offset = params.get_denoising_offset() + DENOISING_PASS_ALBEDO; + break; + case DENOISING_PASS_PREFILTERED_COLOR: + /* If we're not saving the prefiltering result, return the original noisy pass. */ + offset = params.get_denoising_offset() + DENOISING_PASS_COLOR; + break; + default: + return false; + } + scale /= sample; } int pass_stride = params.get_passes_size(); |