[Bf-blender-cvs] [d54e77b] master: Cycles: Expose "Max Bounces" for the world light.

Thomas Dinges noreply at git.blender.org
Sun Jul 12 17:59:28 CEST 2015


Commit: d54e77b66dcb8aaf2dc567c1fce900b3b13ce465
Author: Thomas Dinges
Date:   Sun Jul 12 17:56:54 2015 +0200
Branches: master
https://developer.blender.org/rBd54e77b66dcb8aaf2dc567c1fce900b3b13ce465

Cycles: Expose "Max Bounces" for the world light.

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

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

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

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

diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 16a807b..87c0f7c 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -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"
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index f6ff86a..f7179e2 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -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:")
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 1e17d30..9fa1b35 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -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"))




More information about the Bf-blender-cvs mailing list