Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-06-01 00:49:10 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-06-24 16:17:36 +0300
commit0a3bde63006c66b8b8531ed5eccca9bdf5e5dc20 (patch)
treecf4a577e1fb0cfdaf0c47d56879ae49a21b68c1d /intern/cycles/device/device_task.h
parent88157b9efb2027380c4083d06e4ed61d8d109cef (diff)
Cycles: add denoising settings to the render properties
Enabling render and viewport denoising is now both done from the render properties. View layers still can individually be enabled/disabled for denoising and have their own denoising parameters. Note that the denoising engine also affects how denoising data passes are output even if no denoising happens on the render itself, to make the passes compatible with the engine. This includes internal refactoring for how denoising parameters are passed along, trying to avoid code duplication and unclear naming. Ref T76259
Diffstat (limited to 'intern/cycles/device/device_task.h')
-rw-r--r--intern/cycles/device/device_task.h45
1 files changed, 43 insertions, 2 deletions
diff --git a/intern/cycles/device/device_task.h b/intern/cycles/device/device_task.h
index 5f675bf7e04..1ad8e0d9485 100644
--- a/intern/cycles/device/device_task.h
+++ b/intern/cycles/device/device_task.h
@@ -31,8 +31,32 @@ class RenderBuffers;
class RenderTile;
class Tile;
+enum DenoiserType {
+ DENOISER_NLM = 1,
+ DENOISER_OPTIX = 2,
+ DENOISER_NUM,
+
+ DENOISER_NONE = 0,
+ DENOISER_ALL = ~0,
+};
+
+typedef int DenoiserTypeMask;
+
class DenoiseParams {
public:
+ /* Apply denoiser to image. */
+ bool use;
+ /* Output denoising data passes (possibly without applying the denoiser). */
+ bool store_passes;
+
+ /* Denoiser type. */
+ DenoiserType type;
+
+ /* Viewport start sample. */
+ int start_sample;
+
+ /** Native Denoiser **/
+
/* Pixel radius for neighboring pixels to take into account. */
int radius;
/* Controls neighbor pixel weighting for the denoising filter. */
@@ -46,18 +70,36 @@ class DenoiseParams {
int neighbor_frames;
/* Clamp the input to the range of +-1e8. Should be enough for any legitimate data. */
bool clamp_input;
+
+ /** Optix Denoiser **/
+
/* Passes handed over to the OptiX denoiser (default to color + albedo). */
int optix_input_passes;
DenoiseParams()
{
+ use = false;
+ store_passes = false;
+
+ type = DENOISER_NLM;
+
radius = 8;
strength = 0.5f;
feature_strength = 0.5f;
relative_pca = false;
neighbor_frames = 2;
clamp_input = true;
+
optix_input_passes = 2;
+
+ start_sample = 0;
+ }
+
+ /* Test if a denoising task needs to run, also to prefilter passes for the native
+ * denoiser when we are not applying denoising to the combined image. */
+ bool need_denoising_task() const
+ {
+ return (use || (store_passes && type == DENOISER_NLM));
}
};
@@ -116,8 +158,7 @@ class DeviceTask {
vector<int> denoising_frames;
bool denoising_do_filter;
- bool denoising_use_optix;
- bool denoising_write_passes;
+ bool denoising_do_prefilter;
int pass_stride;
int frame_stride;