[Bf-blender-cvs] [b3c375e37e2] gsoc-2018-many-light-sampling: Fix missing viewport update when toggling light BVH option.

Brecht Van Lommel noreply at git.blender.org
Mon Jul 30 12:47:48 CEST 2018


Commit: b3c375e37e2cbe3027d846129adb7aabc837fa4e
Author: Brecht Van Lommel
Date:   Sun Jul 29 14:53:38 2018 +0200
Branches: gsoc-2018-many-light-sampling
https://developer.blender.org/rBb3c375e37e2cbe3027d846129adb7aabc837fa4e

Fix missing viewport update when toggling light BVH option.

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

M	intern/cycles/blender/addon/properties.py
M	intern/cycles/blender/blender_sync.cpp
M	intern/cycles/render/integrator.cpp

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

diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index b2df2c927e9..974af6238d4 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -197,7 +197,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
 
         cls.splitting_threshold = FloatProperty(
                 name="Splitting",
-                description="Threshold for splitting. 0.0=one light, 1.0=all lights",
+                description="Amount of lights to sample at a time, from one light at 0.0, to adaptively more lights as needed, to all lights at 1.0",
                 min=0.0, max=1.0,
                 default=0.0,
                 )
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 74169a30f53..8f9d8bc34d2 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -326,8 +326,14 @@ void BlenderSync::sync_integrator()
 		integrator->ao_bounces = 0;
 	}
 
-	if(integrator->modified(previntegrator))
+	if(integrator->modified(previntegrator)) {
 		integrator->tag_update(scene);
+	}
+	if(integrator->use_light_bvh != previntegrator.use_light_bvh ||
+	   integrator->splitting_threshold != previntegrator.splitting_threshold)
+	{
+		scene->light_manager->tag_update(scene);
+	}
 }
 
 /* Film */
diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp
index 9c276bcab31..d094262a863 100644
--- a/intern/cycles/render/integrator.cpp
+++ b/intern/cycles/render/integrator.cpp
@@ -67,6 +67,8 @@ NODE_DEFINE(Integrator)
 	SOCKET_BOOLEAN(sample_all_lights_direct, "Sample All Lights Direct", true);
 	SOCKET_BOOLEAN(sample_all_lights_indirect, "Sample All Lights Indirect", true);
 	SOCKET_FLOAT(light_sampling_threshold, "Light Sampling Threshold", 0.05f);
+	SOCKET_BOOLEAN(use_light_bvh, "Use BVH to optimize many light sampling", false);
+	SOCKET_FLOAT(splitting_threshold, "Amount of lights to sample at a time, from one light at 0.0, to adaptively more lights as needed, to all lights at 1.0", 0.0f);
 
 	static NodeEnum method_enum;
 	method_enum.insert("path", PATH);



More information about the Bf-blender-cvs mailing list