Blender  V3.3
denoise.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #pragma once
5 
6 #include "device/memory.h"
7 #include "graph/node.h"
8 #include "session/buffers.h"
9 
11 
16 
19 };
20 
21 /* COnstruct human-readable string which denotes the denoiser type. */
23 
24 typedef int DenoiserTypeMask;
25 
27  /* Best quality of the result without extra processing time, but requires guiding passes to be
28  * noise-free. */
30 
31  /* Denoise color and guiding passes together.
32  * Improves quality when guiding passes are noisy using least amount of extra processing time. */
34 
35  /* Prefilter noisy guiding passes before denoising color.
36  * Improves quality when guiding passes are noisy using extra processing time. */
38 
40 };
41 
42 /* NOTE: Is not a real scene node. Using Node API for ease of (de)serialization.
43  * The default values here do not really matter as they are always initialized from the
44  * Integrator node. */
45 class DenoiseParams : public Node {
46  public:
48 
49  /* Apply denoiser to image. */
50  bool use = false;
51 
52  /* Denoiser type. */
54 
55  /* Viewport start sample. */
56  int start_sample = 0;
57 
58  /* Auxiliary passes. */
59  bool use_pass_albedo = true;
60  bool use_pass_normal = true;
61 
62  /* Configure the denoiser to use motion vectors, previous image and a temporally stable model. */
63  bool temporally_stable = false;
64 
66 
67  static const NodeEnum *get_type_enum();
68  static const NodeEnum *get_prefilter_enum();
69 
70  DenoiseParams();
71 
72  bool modified(const DenoiseParams &other) const
73  {
74  return !(use == other.use && type == other.type && start_sample == other.start_sample &&
78  }
79 };
80 
81 /* All the parameters needed to perform buffer denoising on a device.
82  * Is not really a task in its canonical terms (as in, is not an asynchronous running task). Is
83  * more like a wrapper for all the arguments and parameters needed to perform denoising. Is a
84  * single place where they are all listed, so that it's not required to modify all device methods
85  * when these parameters do change. */
87  public:
89 
91 
94 
95  /* Allow to do in-place modification of the input passes (scaling them down i.e.). This will
96  * lower the memory footprint of the denoiser but will make input passes "invalid" (from path
97  * tracer) point of view. */
99 };
100 
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
DenoiserType type
Definition: denoise.h:53
bool temporally_stable
Definition: denoise.h:63
static const NodeEnum * get_prefilter_enum()
Definition: denoise.cpp:37
static const NodeEnum * get_type_enum()
Definition: denoise.cpp:25
int start_sample
Definition: denoise.h:56
DenoiserPrefilter prefilter
Definition: denoise.h:65
bool modified(const DenoiseParams &other) const
Definition: denoise.h:72
NODE_DECLARE bool use
Definition: denoise.h:50
bool use_pass_normal
Definition: denoise.h:60
bool use_pass_albedo
Definition: denoise.h:59
bool allow_inplace_modification
Definition: denoise.h:98
DenoiseParams params
Definition: denoise.h:88
RenderBuffers * render_buffers
Definition: denoise.h:92
BufferParams buffer_params
Definition: denoise.h:93
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
DenoiserPrefilter
Definition: denoise.h:26
@ DENOISER_PREFILTER_FAST
Definition: denoise.h:33
@ DENOISER_PREFILTER_NONE
Definition: denoise.h:29
@ DENOISER_PREFILTER_NUM
Definition: denoise.h:39
@ DENOISER_PREFILTER_ACCURATE
Definition: denoise.h:37
const char * denoiserTypeToHumanReadable(DenoiserType type)
Definition: denoise.cpp:8
int DenoiserTypeMask
Definition: denoise.h:24
DenoiserType
Definition: denoise.h:12
@ DENOISER_NONE
Definition: denoise.h:17
@ DENOISER_OPTIX
Definition: denoise.h:13
@ DENOISER_OPENIMAGEDENOISE
Definition: denoise.h:14
@ DENOISER_ALL
Definition: denoise.h:18
@ DENOISER_NUM
Definition: denoise.h:15
#define NODE_DECLARE
Definition: node_type.h:135