[Bf-blender-cvs] [bdbb73b1728] cycles_path_guiding: Minor renaming and cleanup

Brecht Van Lommel noreply at git.blender.org
Wed Sep 21 21:47:17 CEST 2022


Commit: bdbb73b17286b1aa387f76d6981f16847f1ee515
Author: Brecht Van Lommel
Date:   Wed Sep 21 18:50:12 2022 +0200
Branches: cycles_path_guiding
https://developer.blender.org/rBbdbb73b17286b1aa387f76d6981f16847f1ee515

Minor renaming and cleanup

===================================================================

M	intern/cycles/blender/addon/properties.py
M	intern/cycles/blender/addon/ui.py
M	intern/cycles/blender/sync.cpp
M	intern/cycles/device/cpu/device_impl.cpp
M	intern/cycles/integrator/path_trace.cpp
M	intern/cycles/integrator/path_trace_work_cpu.cpp
M	intern/cycles/kernel/data_template.h
M	intern/cycles/kernel/integrator/intersect_volume_stack.h
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 e4558070ddf..ade2c89b1be 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -557,7 +557,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         default=True,
     )
 
-    training_samples: IntProperty(
+    guiding_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 "
@@ -575,13 +575,13 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         default=0.5,
     )
 
-    use_guide_direct_light: BoolProperty(
+    use_guiding_direct_light: BoolProperty(
         name="Guide Direct Light",
         description="Consider the contribution of directly visible light sources during guiding",
         default=True,
     )
 
-    use_mis_weights: BoolProperty(
+    use_guiding_mis_weights: BoolProperty(
         name="Use MIS Weights",
         description="Use the MIS weight to weight the contribution of directly visible light sources during guiding",
         default=True,
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 21205f8d404..7036e58f6fb 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -306,7 +306,7 @@ class CYCLES_RENDER_PT_sampling_path_guiding(CyclesButtonsPanel, Panel):
         col = layout.column(align=True)
         col.prop(cscene, "use_surface_guiding")
         col.prop(cscene, "use_volume_guiding")
-        col.prop(cscene, "training_samples")
+        col.prop(cscene, "guiding_training_samples")
 
 
 class CYCLES_RENDER_PT_sampling_path_guiding_debug(CyclesDebugButtonsPanel, Panel):
@@ -331,8 +331,8 @@ class CYCLES_RENDER_PT_sampling_path_guiding_debug(CyclesDebugButtonsPanel, Pane
 
         col = layout.column(align=True)
         col.prop(cscene, "use_deterministic_guiding")
-        col.prop(cscene, "use_guide_direct_light")
-        col.prop(cscene, "use_mis_weights")
+        col.prop(cscene, "use_guiding_direct_light")
+        col.prop(cscene, "use_guiding_mis_weights")
 
 
 class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index c428577aa54..23bc92de022 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender/sync.cpp
@@ -416,14 +416,14 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background)
   integrator->set_use_guiding(get_boolean(cscene, "use_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_samples(get_int(cscene, "training_samples"));
+  integrator->set_guiding_training_samples(get_int(cscene, "guiding_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"));
-    integrator->set_use_mis_weights(get_boolean(cscene, "use_mis_weights"));
+    integrator->set_use_guiding_direct_light(get_boolean(cscene, "use_guiding_direct_light"));
+    integrator->set_use_guiding_mis_weights(get_boolean(cscene, "use_guiding_mis_weights"));
     GuidingDistributionType guiding_distribution_type = (GuidingDistributionType)get_enum(
         cscene, "guiding_distribution_type", GUIDING_NUM_TYPES, GUIDING_TYPE_PARALLAX_AWARE_VMM);
     integrator->set_guiding_distribution_type(guiding_distribution_type);
diff --git a/intern/cycles/device/cpu/device_impl.cpp b/intern/cycles/device/cpu/device_impl.cpp
index 363cf3c0058..ae1592d42e1 100644
--- a/intern/cycles/device/cpu/device_impl.cpp
+++ b/intern/cycles/device/cpu/device_impl.cpp
@@ -305,6 +305,7 @@ void CPUDevice::get_cpu_kernel_thread_globals(
 {
   /* Ensure latest texture info is loaded into kernel globals before returning. */
   load_texture_info();
+
   kernel_thread_globals.clear();
   void *osl_memory = get_cpu_osl_memory();
   for (int i = 0; i < info.cpu_threads; i++) {
diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp
index e1640bda6af..56b8e46ebda 100644
--- a/intern/cycles/integrator/path_trace.cpp
+++ b/intern/cycles/integrator/path_trace.cpp
@@ -173,6 +173,7 @@ void PathTrace::render_pipeline(RenderWork render_work)
 {
   /* NOTE: Only check for "instant" cancel here. The user-requested cancel via progress is
    * checked in Session and the work in the event of cancel is to be finished here. */
+
   render_scheduler_.set_need_schedule_cryptomatte(device_scene_->data.film.cryptomatte_passes !=
                                                   0);
 
@@ -365,6 +366,7 @@ void PathTrace::init_render_buffers(const RenderWork &render_work)
     tile_buffer_read();
   }
 }
+
 void PathTrace::path_trace(RenderWork &render_work)
 {
   if (!render_work.path_trace.num_samples) {
diff --git a/intern/cycles/integrator/path_trace_work_cpu.cpp b/intern/cycles/integrator/path_trace_work_cpu.cpp
index 79d796d0b20..51e13d1ebf4 100644
--- a/intern/cycles/integrator/path_trace_work_cpu.cpp
+++ b/intern/cycles/integrator/path_trace_work_cpu.cpp
@@ -385,19 +385,20 @@ void PathTraceWorkCPU::guiding_push_sample_data_to_global_storage(
 #    endif
 #    if PATH_GUIDING_LEVEL >= 2
   /* Converting the path segment representation of the random walk into radiance samples. */
-  const bool use_guide_direct_light = kernel_data.integrator.use_guide_direct_light;
-  const bool use_mis_weights = kernel_data.integrator.use_mis_weights;
+  const bool use_direct_light = kernel_data.integrator.use_guiding_direct_light;
+  const bool use_mis_weights = kernel_data.integrator.use_guiding_mis_weights;
   state->guiding.path_segment_storage->PrepareSamples(
-      false, nullptr, use_mis_weights, use_guide_direct_light, false);
+      false, nullptr, use_mis_weights, use_direct_light, false);
 #    endif
 
 #    if defined(WITH_CYCLES_DEBUG) && PATH_GUIDING_LEVEL >= 5
   /* Checking if the training/radiance samples generated py the path segment storage are valid.*/
   if (VLOG_DEBUG_IS_ON) {
     const bool validSamples = state->guiding.path_segment_storage->ValidateSamples();
-    if (!validSamples)
+    if (!validSamples) {
       VLOG_DEBUG
           << "Guiding: Path segment storage generated/contains invalid radiance/training samples!";
+    }
   }
 #    endif
 
diff --git a/intern/cycles/kernel/data_template.h b/intern/cycles/kernel/data_template.h
index fb54785c4a9..1e9e25f2f9d 100644
--- a/intern/cycles/kernel/data_template.h
+++ b/intern/cycles/kernel/data_template.h
@@ -199,15 +199,12 @@ KERNEL_STRUCT_MEMBER(integrator, int, direct_light_sampling_type)
 KERNEL_STRUCT_MEMBER(integrator, float, surface_guiding_probability)
 KERNEL_STRUCT_MEMBER(integrator, float, volume_guiding_probability)
 KERNEL_STRUCT_MEMBER(integrator, int, guiding_distribution_type)
-KERNEL_STRUCT_MEMBER(integrator, bool, use_guiding)
-KERNEL_STRUCT_MEMBER(integrator, bool, train_guiding)
-KERNEL_STRUCT_MEMBER(integrator, bool, use_surface_guiding)
-KERNEL_STRUCT_MEMBER(integrator, bool, use_volume_guiding)
-KERNEL_STRUCT_MEMBER(integrator, bool, use_guide_direct_light)
-KERNEL_STRUCT_MEMBER(integrator, bool, use_mis_weights)
-/* Padding */
-KERNEL_STRUCT_MEMBER(integrator, bool, pad1)
-KERNEL_STRUCT_MEMBER(integrator, bool, pad2)
+KERNEL_STRUCT_MEMBER(integrator, int, use_guiding)
+KERNEL_STRUCT_MEMBER(integrator, int, train_guiding)
+KERNEL_STRUCT_MEMBER(integrator, int, use_surface_guiding)
+KERNEL_STRUCT_MEMBER(integrator, int, use_volume_guiding)
+KERNEL_STRUCT_MEMBER(integrator, int, use_guiding_direct_light)
+KERNEL_STRUCT_MEMBER(integrator, int, use_guiding_mis_weights)
 KERNEL_STRUCT_END(KernelIntegrator)
 
 /* SVM. For shader specialization. */
diff --git a/intern/cycles/kernel/integrator/intersect_volume_stack.h b/intern/cycles/kernel/integrator/intersect_volume_stack.h
index 1cd19b0e360..c2490581e4d 100644
--- a/intern/cycles/kernel/integrator/intersect_volume_stack.h
+++ b/intern/cycles/kernel/integrator/intersect_volume_stack.h
@@ -5,8 +5,6 @@
 
 #include "kernel/bvh/bvh.h"
 #include "kernel/geom/geom.h"
-
-#include "kernel/integrator/guiding.h"
 #include "kernel/integrator/volume_stack.h"
 
 CCL_NAMESPACE_BEGIN
diff --git a/intern/cycles/scene/integrator.cpp b/intern/cycles/scene/integrator.cpp
index b6311bea21a..ade4716242b 100644
--- a/intern/cycles/scene/integrator.cpp
+++ b/intern/cycles/scene/integrator.cpp
@@ -71,9 +71,9 @@ NODE_DEFINE(Integrator)
   SOCKET_FLOAT(surface_guiding_probability, "Surface Guiding Probability", 0.5f);
   SOCKET_BOOLEAN(use_volume_guiding, "Volume Guiding", true);
   SOCKET_FLOAT(volume_guiding_probability, "Volume Guiding Probability", 0.5f);
-  SOCKET_INT(training_samples, "Training Samples", 128);
-  SOCKET_BOOLEAN(use_guide_direct_light, "Guide Direct Light", true);
-  SOCKET_BOOLEAN(use_mis_weights, "Use MIS Weights", true);
+  SOCKET_INT(guiding_training_samples, "Training Samples", 128);
+  SOCKET_BOOLEAN(use_guiding_direct_light, "Guide Direct Light", true);
+  SOCKET_BOOLEAN(use_guiding_mis_weights, "Use MIS Weights", true);
   SOCKET_ENUM(guiding_distribution_type,
               "Guiding Distribution Type",
               guiding_ditribution_enum,
@@ -235,8 +235,8 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
   kintegrator->use_volume_guiding = guiding_params.use_volume_guiding;
   kintegrator->surface_guiding_probability = surface_guiding_probability;
   kintegrator->volume_guiding_probability = volume_guiding_probability;
-  kintegrator->use_guide_direct_light = use_guide_direct_light;
-  kintegrator->use_mis_weights = use_mis_weights;
+  kintegrator->use_guiding_direct_light = use_guiding_dir

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list