From 51e898324de30c0985a80e5bc067358b5ccedbfc Mon Sep 17 00:00:00 2001 From: Stefan Werner Date: Thu, 5 Mar 2020 12:05:42 +0100 Subject: Adaptive Sampling for Cycles. This feature takes some inspiration from "RenderMan: An Advanced Path Tracing Architecture for Movie Rendering" and "A Hierarchical Automatic Stopping Condition for Monte Carlo Global Illumination" The basic principle is as follows: While samples are being added to a pixel, the adaptive sampler writes half of the samples to a separate buffer. This gives it two separate estimates of the same pixel, and by comparing their difference it estimates convergence. Once convergence drops below a given threshold, the pixel is considered done. When a pixel has not converged yet and needs more samples than the minimum, its immediate neighbors are also set to take more samples. This is done in order to more reliably detect sharp features such as caustics. A 3x3 box filter that is run periodically over the tile buffer is used for that purpose. After a tile has finished rendering, the values of all passes are scaled as if they were rendered with the full number of samples. This way, any code operating on these buffers, for example the denoiser, does not need to be changed for per-pixel sample counts. Reviewed By: brecht, #cycles Differential Revision: https://developer.blender.org/D4686 --- intern/cycles/kernel/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'intern/cycles/kernel/CMakeLists.txt') diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 566b6e3d191..0dd0da65f82 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -36,6 +36,10 @@ set(SRC_CUDA_KERNELS ) set(SRC_OPENCL_KERNELS + kernels/opencl/kernel_adaptive_stopping.cl + kernels/opencl/kernel_adaptive_filter_x.cl + kernels/opencl/kernel_adaptive_filter_y.cl + kernels/opencl/kernel_adaptive_adjust_samples.cl kernels/opencl/kernel_bake.cl kernels/opencl/kernel_base.cl kernels/opencl/kernel_displace.cl @@ -94,6 +98,7 @@ set(SRC_BVH_HEADERS set(SRC_HEADERS kernel_accumulate.h + kernel_adaptive_sampling.h kernel_bake.h kernel_camera.h kernel_color.h @@ -324,6 +329,10 @@ set(SRC_UTIL_HEADERS ) set(SRC_SPLIT_HEADERS + split/kernel_adaptive_adjust_samples.h + split/kernel_adaptive_filter_x.h + split/kernel_adaptive_filter_y.h + split/kernel_adaptive_stopping.h split/kernel_branched.h split/kernel_buffer_update.h split/kernel_data_init.h -- cgit v1.2.3