Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/device_denoise.h
| Show All 29 Lines | enum DenoiserType { | ||||
| DENOISER_ALL = ~0, | DENOISER_ALL = ~0, | ||||
| }; | }; | ||||
| /* COnstruct human-readable string which denotes the denoiser type. */ | /* COnstruct human-readable string which denotes the denoiser type. */ | ||||
| const char *denoiserTypeToHumanReadable(DenoiserType type); | const char *denoiserTypeToHumanReadable(DenoiserType type); | ||||
| typedef int DenoiserTypeMask; | typedef int DenoiserTypeMask; | ||||
| enum DenoiserPrefilter { | |||||
| /* Best quality of the result without extra processing time, but requires guiding passes to be | |||||
| * noise-free. */ | |||||
| DENOISER_PREFILTER_NONE = 1, | |||||
| /* Denoise color and guiding passes together. | |||||
| * Improves quality when guiding passes are noisy using least amount of extra processing time. */ | |||||
| DENOISER_PREFILTER_FAST = 2, | |||||
| /* Prefilter noisy guiding passes before denoising color. | |||||
| * Improves quality when guiding passes are noisy using extra processing time. */ | |||||
| DENOISER_PREFILTER_ACCURATE = 3, | |||||
| DENOISER_PREFILTER_NUM, | |||||
| }; | |||||
| class DenoiseParams { | class DenoiseParams { | ||||
| public: | public: | ||||
| /* Apply denoiser to image. */ | /* Apply denoiser to image. */ | ||||
| bool use = false; | bool use = false; | ||||
| /* Output denoising data passes (possibly without applying the denoiser). */ | /* Output denoising data passes (possibly without applying the denoiser). */ | ||||
| bool store_passes = false; | bool store_passes = false; | ||||
| /* Denoiser type. */ | /* Denoiser type. */ | ||||
| DenoiserType type = DENOISER_OPENIMAGEDENOISE; | DenoiserType type = DENOISER_OPENIMAGEDENOISE; | ||||
| /* Viewport start sample. */ | /* Viewport start sample. */ | ||||
| int start_sample = 0; | int start_sample = 0; | ||||
| /* Extra passes which are used by the denoiser (the color pass is always used). | /* Extra passes which are used by the denoiser (the color pass is always used). | ||||
| * Default to color + albedo only, since normal input does not always have the desired effect | * Default to color + albedo only, since normal input does not always have the desired effect | ||||
| * when denoising with OptiX. */ | * when denoising with OptiX. */ | ||||
| bool use_pass_albedo = true; | bool use_pass_albedo = true; | ||||
| bool use_pass_normal = false; | bool use_pass_normal = false; | ||||
| bool use_prefilter = false; | DenoiserPrefilter prefilter = DENOISER_PREFILTER_FAST; | ||||
| DenoiseParams() = default; | DenoiseParams() = default; | ||||
| bool modified(const DenoiseParams &other) const | bool modified(const DenoiseParams &other) const | ||||
| { | { | ||||
| return !(use == other.use && store_passes == other.store_passes && type == other.type && | return !(use == other.use && store_passes == other.store_passes && type == other.type && | ||||
| start_sample == other.start_sample && use_pass_albedo == other.use_pass_albedo && | start_sample == other.start_sample && use_pass_albedo == other.use_pass_albedo && | ||||
| use_pass_normal == other.use_pass_normal && use_prefilter == other.use_prefilter); | use_pass_normal == other.use_pass_normal && prefilter == other.prefilter); | ||||
| } | } | ||||
| }; | }; | ||||
| /* All the parameters needed to perform buffer denoising on a device. | /* All the parameters needed to perform buffer denoising on a device. | ||||
| * Is not really a task in its canonical terms (as in, is not an asynchronous running task). Is | * Is not really a task in its canonical terms (as in, is not an asynchronous running task). Is | ||||
| * more like a wrapper for all the arguments and parameters needed to perform denoising. Is a | * more like a wrapper for all the arguments and parameters needed to perform denoising. Is a | ||||
| * single place where they are all listed, so that it's not required to modify all device methods | * single place where they are all listed, so that it's not required to modify all device methods | ||||
| * when these parameters do change. */ | * when these parameters do change. */ | ||||
| Show All 16 Lines | |||||