Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Herholz <sherholz>2021-11-17 19:26:46 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-17 20:03:56 +0300
commitd9bc8f189cc36cc55082cfd7ad8845e96eb062e3 (patch)
tree0fe69c7ae01d5fa3dd68e5d719bae9a757f4ec83 /intern/cycles/scene/integrator.cpp
parent063ad8635ec87a490d6fc02c937387a3c6673b08 (diff)
Cycles: add build option to enable a debugging feature for MIS
This patch adds a CMake option "WITH_CYCLES_DEBUG" which builds cycles with a feature that allows debugging/selecting the direct-light sampling strategy. The same option may later be used to add other debugging features that could affect performance in release builds. The three options are: * Forward path tracing (e.g., via BSDF or phase function) * Next-event estimation * Multiple importance sampling combination of the previous two methods Such a feature is useful for debugging light different sampling, evaluation, and pdf methods (e.g., for light sources and BSDFs). Differential Revision: https://developer.blender.org/D13152
Diffstat (limited to 'intern/cycles/scene/integrator.cpp')
-rw-r--r--intern/cycles/scene/integrator.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/intern/cycles/scene/integrator.cpp b/intern/cycles/scene/integrator.cpp
index 737db8b98d5..9216a8ae615 100644
--- a/intern/cycles/scene/integrator.cpp
+++ b/intern/cycles/scene/integrator.cpp
@@ -52,6 +52,18 @@ NODE_DEFINE(Integrator)
SOCKET_INT(transparent_min_bounce, "Transparent Min Bounce", 0);
SOCKET_INT(transparent_max_bounce, "Transparent Max Bounce", 7);
+#ifdef WITH_CYCLES_DEBUG
+ static NodeEnum direct_light_sampling_type_enum;
+ direct_light_sampling_type_enum.insert("multiple_importance_sampling",
+ DIRECT_LIGHT_SAMPLING_MIS);
+ direct_light_sampling_type_enum.insert("forward_path_tracing", DIRECT_LIGHT_SAMPLING_FORWARD);
+ direct_light_sampling_type_enum.insert("next_event_estimation", DIRECT_LIGHT_SAMPLING_NEE);
+ SOCKET_ENUM(direct_light_sampling_type,
+ "Direct Light Sampling Type",
+ direct_light_sampling_type_enum,
+ DIRECT_LIGHT_SAMPLING_MIS);
+#endif
+
SOCKET_INT(ao_bounces, "AO Bounces", 0);
SOCKET_FLOAT(ao_factor, "AO Factor", 0.0f);
SOCKET_FLOAT(ao_distance, "AO Distance", FLT_MAX);
@@ -171,6 +183,12 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
kintegrator->ao_bounces_factor = ao_factor;
kintegrator->ao_additive_factor = ao_additive_factor;
+#ifdef WITH_CYCLES_DEBUG
+ kintegrator->direct_light_sampling_type = direct_light_sampling_type;
+#else
+ kintegrator->direct_light_sampling_type = DIRECT_LIGHT_SAMPLING_MIS;
+#endif
+
/* Transparent Shadows
* We only need to enable transparent shadows, if we actually have
* transparent shaders in the scene. Otherwise we can disable it