Cycles: Add option to change input passes for viewport denoising

There are cases where the default input passes of color+albedo do not yield useful results
and while this was possible to change that for final frame rendering (in the layer settings),
viewport denoising always used a fixed color+albedo. This adds an option to change the
input passes for viewport denoising too, so that one can use it in scenes that otherwise
wouldn't work well with it.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10404
This commit is contained in:
Patrick Mours 2021-02-22 18:09:48 +01:00
parent bfb2e87a9e
commit b2e1b13abd
3 changed files with 14 additions and 1 deletions

View File

@ -646,6 +646,12 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
min=0, max=(1 << 24),
default=1,
)
preview_denoising_input_passes: EnumProperty(
name="Viewport Input Passes",
description="Passes used by the denoiser to distinguish noise from shader and geometry detail",
items=enum_denoising_input_passes,
default='RGB_ALBEDO',
)
debug_reset_timeout: FloatProperty(
name="Reset timeout",
@ -1434,7 +1440,6 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
items=enum_denoising_input_passes,
default='RGB_ALBEDO',
)
denoising_openimagedenoise_input_passes: EnumProperty(
name="Input Passes",
description="Passes used by the denoiser to distinguish noise from shader and geometry detail",

View File

@ -275,6 +275,8 @@ class CYCLES_RENDER_PT_sampling_denoising(CyclesButtonsPanel, Panel):
sub.prop(cscene, "denoiser", text="")
layout.separator()
heading = layout.column(align=False, heading="Viewport")
row = heading.row(align=True)
row.prop(cscene, "use_preview_denoising", text="")
@ -285,6 +287,9 @@ class CYCLES_RENDER_PT_sampling_denoising(CyclesButtonsPanel, Panel):
sub = heading.row(align=True)
sub.active = cscene.use_preview_denoising
sub.prop(cscene, "preview_denoising_start_sample", text="Start Sample")
sub = heading.row(align=True)
sub.active = cscene.use_preview_denoising
sub.prop(cscene, "preview_denoising_input_passes", text="Input Passes")
class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):

View File

@ -1005,6 +1005,9 @@ DenoiseParams BlenderSync::get_denoise_params(BL::Scene &b_scene,
cscene, "preview_denoiser", DENOISER_NUM, DENOISER_NONE);
denoising.start_sample = get_int(cscene, "preview_denoising_start_sample");
denoising.input_passes = (DenoiserInput)get_enum(
cscene, "preview_denoising_input_passes", DENOISER_INPUT_NUM, (int)denoising.input_passes);
/* Auto select fastest denoiser. */
if (denoising.type == DENOISER_NONE) {
if (!Device::available_devices(DEVICE_MASK_OPTIX).empty()) {