[Bf-blender-cvs] [8ec9800ef68] cycles_path_guiding: UI and defaults changes:
Brecht Van Lommel
noreply at git.blender.org
Tue Sep 20 21:00:37 CEST 2022
Commit: 8ec9800ef680e2ffb70f4108eb350b739f95e4e3
Author: Brecht Van Lommel
Date: Mon Sep 19 17:33:49 2022 +0200
Branches: cycles_path_guiding
https://developer.blender.org/rB8ec9800ef680e2ffb70f4108eb350b739f95e4e3
UI and defaults changes:
* Renaming Training Iterations to Samples, make 0 infinite samples matching
the viewport samples behavior.
* Enable deterministic path guiding by default, make it debug option. Not
yet ready to give on deterministic rendering even if it comes at a
performance cost.
* Disable guiding by default internaly (was already done in Blender).
* Improve tooltips.
* Move Path Guiding panel above Advanced.
===================================================================
M intern/cycles/blender/addon/properties.py
M intern/cycles/blender/addon/ui.py
M intern/cycles/blender/sync.cpp
M intern/cycles/integrator/guiding.h
M intern/cycles/integrator/path_trace.cpp
M intern/cycles/scene/integrator.cpp
M intern/cycles/scene/integrator.h
===================================================================
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 3afb27a1ac7..e4558070ddf 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -364,7 +364,9 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
preview_samples: IntProperty(
name="Viewport Samples",
description="Number of samples to render in the viewport, unlimited if 0",
- min=0, max=(1 << 24),
+ min=0,
+ soft_min=1,
+ max=(1 << 24),
default=1024,
)
@@ -521,12 +523,12 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
default=False,
)
- deterministic_guiding: BoolProperty(
+ use_deterministic_guiding: BoolProperty(
name="Deterministic",
description="Makes path guiding deterministic which means renderings will be"
- "reproducable (i.e., same pixel noise/value). This feature increases the"
- "compute time during training",
- default=False,
+ "reproducible with the same pixel values every time. This feature slows down"
+ "training",
+ default=True,
)
guiding_distribution_type: EnumProperty(
@@ -555,13 +557,14 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
default=True,
)
- training_iterations: IntProperty(
- name="Training Iterations",
- description="The number of training iterations (i.e., SPPs) used for the guiding structures."
- "If the this number is reached the guiding structure is used for sampling only which avoids the"
- " computational over head of the training process."
- "A value of -1 leads to continuous learning.",
- min=-1,
+ training_samples: IntProperty(
+ name="Training Samples",
+ description="The maximum number of samples used for training path guiding. "
+ "Higher samples lead to more accurate guiding, however may also unnecessarily slow "
+ "down rendering once guiding is accurate enough. "
+ "A value 0 will continue training until the last sample",
+ min=0,
+ soft_min=1,
default=128,
)
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 5181a41e993..21205f8d404 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -278,51 +278,6 @@ class CYCLES_RENDER_PT_sampling_render_denoise(CyclesButtonsPanel, Panel):
col.prop(cscene, "denoising_prefilter", text="Prefilter")
-class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
- bl_label = "Advanced"
- bl_parent_id = "CYCLES_RENDER_PT_sampling"
- bl_options = {'DEFAULT_CLOSED'}
-
- def draw(self, context):
- layout = self.layout
- layout.use_property_split = True
- layout.use_property_decorate = False
-
- scene = context.scene
- cscene = scene.cycles
-
- row = layout.row(align=True)
- row.prop(cscene, "seed")
- row.prop(cscene, "use_animated_seed", text="", icon='TIME')
-
- col = layout.column(align=True)
- col.prop(cscene, "sampling_pattern", text="Pattern")
-
- col = layout.column(align=True)
- col.prop(cscene, "sample_offset")
-
- layout.separator()
-
- heading = layout.column(align=True, heading="Scrambling Distance")
- heading.active = cscene.sampling_pattern != 'SOBOL'
- heading.prop(cscene, "auto_scrambling_distance", text="Automatic")
- heading.prop(cscene, "preview_scrambling_distance", text="Viewport")
- heading.prop(cscene, "scrambling_distance", text="Multiplier")
-
- layout.separator()
-
- col = layout.column(align=True)
- col.prop(cscene, "min_light_bounces")
- col.prop(cscene, "min_transparent_bounces")
- col.prop(cscene, "light_sampling_threshold", text="Light Threshold")
-
- for view_layer in scene.view_layers:
- if view_layer.samples > 0:
- layout.separator()
- layout.row().prop(cscene, "use_layer_samples")
- break
-
-
class CYCLES_RENDER_PT_sampling_path_guiding(CyclesButtonsPanel, Panel):
bl_label = "Path Guiding"
bl_parent_id = "CYCLES_RENDER_PT_sampling"
@@ -349,10 +304,9 @@ class CYCLES_RENDER_PT_sampling_path_guiding(CyclesButtonsPanel, Panel):
layout.active = cscene.use_guiding
col = layout.column(align=True)
- col.prop(cscene, "deterministic_guiding", text="Deterministic")
- col.prop(cscene, "use_surface_guiding", text="Surface Guiding")
- col.prop(cscene, "use_volume_guiding", text="Volume Guiding")
- col.prop(cscene, "training_iterations", text="Training Iterations")
+ col.prop(cscene, "use_surface_guiding")
+ col.prop(cscene, "use_volume_guiding")
+ col.prop(cscene, "training_samples")
class CYCLES_RENDER_PT_sampling_path_guiding_debug(CyclesDebugButtonsPanel, Panel):
@@ -372,12 +326,58 @@ class CYCLES_RENDER_PT_sampling_path_guiding_debug(CyclesDebugButtonsPanel, Pane
layout.prop(cscene, "guiding_distribution_type", text="Distribution Type")
col = layout.column(align=True)
- col.prop(cscene, "surface_guiding_probability", text="Surface Guiding Probability")
- col.prop(cscene, "volume_guiding_probability", text="Volume Guiding Probability")
+ col.prop(cscene, "surface_guiding_probability")
+ col.prop(cscene, "volume_guiding_probability")
+
+ col = layout.column(align=True)
+ col.prop(cscene, "use_deterministic_guiding")
+ col.prop(cscene, "use_guide_direct_light")
+ col.prop(cscene, "use_mis_weights")
+
+
+class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
+ bl_label = "Advanced"
+ bl_parent_id = "CYCLES_RENDER_PT_sampling"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ scene = context.scene
+ cscene = scene.cycles
+
+ row = layout.row(align=True)
+ row.prop(cscene, "seed")
+ row.prop(cscene, "use_animated_seed", text="", icon='TIME')
+
+ col = layout.column(align=True)
+ col.prop(cscene, "sampling_pattern", text="Pattern")
+
+ col = layout.column(align=True)
+ col.prop(cscene, "sample_offset")
+
+ layout.separator()
+
+ heading = layout.column(align=True, heading="Scrambling Distance")
+ heading.active = cscene.sampling_pattern != 'SOBOL'
+ heading.prop(cscene, "auto_scrambling_distance", text="Automatic")
+ heading.prop(cscene, "preview_scrambling_distance", text="Viewport")
+ heading.prop(cscene, "scrambling_distance", text="Multiplier")
+
+ layout.separator()
col = layout.column(align=True)
- col.prop(cscene, "use_guide_direct_light", text="Guide Direct Light")
- col.prop(cscene, "use_mis_weights", text="Use MIS Weights")
+ col.prop(cscene, "min_light_bounces")
+ col.prop(cscene, "min_transparent_bounces")
+ col.prop(cscene, "light_sampling_threshold", text="Light Threshold")
+
+ for view_layer in scene.view_layers:
+ if view_layer.samples > 0:
+ layout.separator()
+ layout.row().prop(cscene, "use_layer_samples")
+ break
class CYCLES_RENDER_PT_subdivision(CyclesButtonsPanel, Panel):
@@ -2343,9 +2343,9 @@ classes = (
CYCLES_RENDER_PT_sampling_viewport_denoise,
CYCLES_RENDER_PT_sampling_render,
CYCLES_RENDER_PT_sampling_render_denoise,
- CYCLES_RENDER_PT_sampling_advanced,
CYCLES_RENDER_PT_sampling_path_guiding,
CYCLES_RENDER_PT_sampling_path_guiding_debug,
+ CYCLES_RENDER_PT_sampling_advanced,
CYCLES_RENDER_PT_light_paths,
CYCLES_RENDER_PT_light_paths_max_bounces,
CYCLES_RENDER_PT_light_paths_clamping,
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index 7bff9177665..c428577aa54 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender/sync.cpp
@@ -414,12 +414,12 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background)
#endif
integrator->set_use_guiding(get_boolean(cscene, "use_guiding"));
- integrator->set_deterministic_guiding(get_boolean(cscene, "deterministic_guiding"));
integrator->set_use_surface_guiding(get_boolean(cscene, "use_surface_guiding"));
integrator->set_use_volume_guiding(get_boolean(cscene, "use_volume_guiding"));
- integrator->set_training_iterations(get_int(cscene, "training_iterations"));
+ integrator->set_training_samples(get_int(cscene, "training_samples"));
if (use_developer_ui) {
+ integrator->set_deterministic_guiding(get_boolean(cscene, "use_deterministic_guiding"));
integrator->set_surface_guiding_probability(get_float(cscene, "surface_guiding_probability"));
integrator->set_volume_guiding_probability(get_float(cscene, "volume_guiding_probability"));
integrator->set_use_guide_direct_light(get_boolean(cscene, "use_guide_direct_light"));
diff --git a/intern/cycles/integrator/guiding.h b/intern/cycles/integrator/guiding.h
index b98813598fe..b7d7e2fe51e 100644
--- a/intern/cycles/integrator/guiding.h
+++ b/intern/cycles/integrator/guiding.h
@@ -15,7 +15,7 @@ struct GuidingParams {
bool use_volume_guiding = false;
GuidingDistributionType type = GUIDING_TYPE_PARALLAX_AWARE_VMM;
- int training_iterations = 128;
+ int training_samples = 128;
bool deterministic = false;
GuidingParams() = default;
@@ -24,7 +24,7 @@ struct GuidingParams {
{
return !((use == other.use) && (use_surface_guiding == other.use_surface_guiding) &&
(use_volume_guiding == other.use_volume_guiding) && (type == other.type) &&
- (training_iterations == other.training_iterations) &&
+ (training_samples == other.training_samples) &&
(deterministic == other.deterministic));
}
};
diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp
index 985287bad51..4ee30bb027
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list