From 405cacd4cd955552e1f7b50a176ddcdd9baf8d3b Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Wed, 6 Feb 2019 12:42:10 +0100 Subject: Cycles: prefilter feature passes separate from denoising. Prefiltering of feature passes will happen during rendering, which can then be used for denoising immediately or written as a render pass for later (animation) denoising. The number of denoising data passes written is reduced because of this, leaving out the feature variance passes. The passes are now Normal, Albedo, Depth, Shadowing, Variance and Intensity. Ref D3889. --- intern/cycles/device/device_denoising.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'intern/cycles/device/device_denoising.h') diff --git a/intern/cycles/device/device_denoising.h b/intern/cycles/device/device_denoising.h index beae60c220f..cddcd3bd0c9 100644 --- a/intern/cycles/device/device_denoising.h +++ b/intern/cycles/device/device_denoising.h @@ -47,6 +47,7 @@ public: int stride; int pass_stride; int denoising_clean_offset; + int denoising_output_offset; device_ptr ptr; } target_buffer; @@ -58,6 +59,9 @@ public: int4 rect; int4 filter_area; + bool write_passes; + bool do_filter; + struct DeviceFunctions { function non_local_means; function reconstruct; + device_ptr scale_ptr + )> accumulate; + function solve; function construct_transform; function get_feature; function detect_outliers; + function write_feature; function map_neighbor_tiles; function unmap_neighbor_tiles; } functions; @@ -114,8 +124,9 @@ public: int f; /* Patch size of the filter. */ float a; /* Variance compensation factor in the MSE estimation. */ float k_2; /* Squared value of the k parameter of the filter. */ + bool is_color; - void set_parameters(int r_, int f_, float a_, float k_2_) { r = r_; f = f_; a = a_, k_2 = k_2_; } + void set_parameters(int r_, int f_, float a_, float k_2_, bool is_color_) { r = r_; f = f_; a = a_, k_2 = k_2_; is_color = is_color_; } } nlm_state; struct Storage { @@ -147,6 +158,7 @@ public: int width; device_only_memory mem; device_only_memory temporary_mem; + bool use_intensity; bool gpu_temporary_mem; @@ -166,6 +178,8 @@ protected: void prefilter_color(); void construct_transform(); void reconstruct(); + + void write_buffer(); }; CCL_NAMESPACE_END -- cgit v1.2.3