Cycles: Expose "Max Bounces" for the world light.
authorThomas Dinges <blender@dingto.org>
Sun, 12 Jul 2015 15:56:54 +0000 (17:56 +0200)
committerThomas Dinges <blender@dingto.org>
Sun, 12 Jul 2015 15:56:54 +0000 (17:56 +0200)
When using MIS, the world is treated as regular light and in this case
we can now also limit the maximum amount of bounces, the background light
will contribute to the scene.

This can improve performance in some cases, where it's e.g. sufficient to
only have a contribution on first 1-2 bounces.
Examples can be found in the differential.

Differential revision: https://developer.blender.org/D1399

intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_object.cpp

index 16a807b3af50c084b589ef198e19c20e3bc2d465..87c0f7c154ab7d3732b2a763d790338555854640 100644 (file)
@@ -739,6 +739,12 @@ class CyclesWorldSettings(bpy.types.PropertyGroup):
                 min=1, max=10000,
                 default=4,
                 )
+        cls.max_bounces = IntProperty(
+                name="Max Bounces",
+                description="Maximum number of bounces the background light will contribute to the render",
+                min=0, max=1024,
+                default=1024,
+                )
         cls.homogeneous_volume = BoolProperty(
                 name="Homogeneous Volume",
                 description="When using volume rendering, assume volume has the same density everywhere"
index f6ff86ac30e4a0a2ff58c7fd3dc046efaadbcba6..f7179e2472b53dbc2ec163dde99728666c6c6b47 100644 (file)
@@ -1040,6 +1040,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
         sub.prop(cworld, "sample_map_resolution")
         if use_branched_path(context):
             sub.prop(cworld, "samples")
+        sub.prop(cworld, "max_bounces")
 
         col = split.column()
         col.label(text="Volume:")
index 1e17d306fd0ca9d9a6fbbd64981d878d5f9180f0..9fa1b35d2ad698c464ac3085dba8ec1f0fc230da 100644 (file)
@@ -215,6 +215,7 @@ void BlenderSync::sync_background_light(bool use_portal)
                                light->map_resolution  = get_int(cworld, "sample_map_resolution");
                                light->shader = scene->default_background;
                                light->use_mis = sample_as_light;
+                               light->max_bounces = get_int(cworld, "max_bounces");
 
                                int samples = get_int(cworld, "samples");
                                if(get_boolean(cscene, "use_square_samples"))