[Bf-blender-cvs] [3a476e7b71e] soc-2020-production-ready-light-tree: Fixed a couple of tests with volumes with light tree disabled.

Sam Kottler noreply at git.blender.org
Sat Jul 25 21:21:42 CEST 2020


Commit: 3a476e7b71e0529118350690d980b70bd4d98938
Author: Sam Kottler
Date:   Sat Jul 25 13:20:41 2020 -0600
Branches: soc-2020-production-ready-light-tree
https://developer.blender.org/rB3a476e7b71e0529118350690d980b70bd4d98938

Fixed a couple of tests with volumes with light tree disabled.

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

M	build_files/build_environment/patches/cmakelists_tbb.txt
M	intern/cycles/kernel/kernel_light.h
M	intern/cycles/kernel/kernel_path_surface.h
M	intern/cycles/kernel/kernel_path_volume.h
M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib
M	source/tools

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

diff --git a/build_files/build_environment/patches/cmakelists_tbb.txt b/build_files/build_environment/patches/cmakelists_tbb.txt
index 7edf3aa2785..16ef161434c 100644
--- a/build_files/build_environment/patches/cmakelists_tbb.txt
+++ b/build_files/build_environment/patches/cmakelists_tbb.txt
@@ -148,7 +148,7 @@ if (TBB_BUILD_SHARED)
     set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
   elseif(WIN32)
     set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
-    
+
   endif()
   install(TARGETS tbb DESTINATION lib)
   if(WIN32)
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index 41afe50b41a..2e2f7349d94 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -48,7 +48,7 @@ ccl_device void kernel_update_light_picking(KernelGlobals *kg,
                                             Ray *ray)
 {
   if (ray) {
-    sd->P_pick = ray->P + ray->D * ray->t;
+    sd->P_pick = sd->P;  // ray->P + ray->D * ray->t;
     sd->N_pick = -ray->D;
     sd->t_pick = ray->t;
     return;
diff --git a/intern/cycles/kernel/kernel_path_surface.h b/intern/cycles/kernel/kernel_path_surface.h
index 346328e4804..1e24f73dd5c 100644
--- a/intern/cycles/kernel/kernel_path_surface.h
+++ b/intern/cycles/kernel/kernel_path_surface.h
@@ -66,6 +66,7 @@ ccl_device void accum_light_tree_contribution(KernelGlobals *kg,
 {
   float3 P = sd->P_pick;
   float3 N = sd->N_pick;
+  float t = sd->t_pick;
 
   float time = sd->time;
   int bounce = state->bounce;
@@ -101,7 +102,7 @@ ccl_device void accum_light_tree_contribution(KernelGlobals *kg,
          * see comment in light_tree_sample() for this piece of code */
         float sum = 0.0f;
         for (int i = 0; i < num_emitters; ++i) {
-          sum += calc_light_importance(kg, -1.0f, P, N, offset, i);
+          sum += calc_light_importance(kg, t, P, N, offset, i);
         }
 
         if (sum == 0.0f) {
@@ -115,7 +116,7 @@ ccl_device void accum_light_tree_contribution(KernelGlobals *kg,
         float prob = 0.0f;
         int light = num_emitters - 1;
         for (int i = 1; i < num_emitters + 1; ++i) {
-          prob = calc_light_importance(kg, -1.0f, P, N, offset, i - 1) * sum_inv;
+          prob = calc_light_importance(kg, t, P, N, offset, i - 1) * sum_inv;
           cdf_R = cdf_L + prob;
           if (randu < cdf_R) {
             light = i - 1;
@@ -194,8 +195,8 @@ ccl_device void accum_light_tree_contribution(KernelGlobals *kg,
         /* go down one of the child nodes */
 
         /* evaluate the importance of each of the child nodes */
-        float I_L = calc_node_importance(kg, -1.0f, P, N, child_offsetL);
-        float I_R = calc_node_importance(kg, -1.0f, P, N, child_offsetR);
+        float I_L = calc_node_importance(kg, t, P, N, child_offsetL);
+        float I_R = calc_node_importance(kg, t, P, N, child_offsetR);
 
         if ((I_L == 0.0f) && (I_R == 0.0f)) {
           return;
diff --git a/intern/cycles/kernel/kernel_path_volume.h b/intern/cycles/kernel/kernel_path_volume.h
index 2a4e811417f..668172df42d 100644
--- a/intern/cycles/kernel/kernel_path_volume.h
+++ b/intern/cycles/kernel/kernel_path_volume.h
@@ -149,6 +149,7 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg,
 {
 #    ifdef __EMISSION__
   BsdfEval L_light ccl_optional_struct_init;
+
   bool use_light_tree = kernel_data.integrator.use_light_tree;
   int num_lights = 1;
   if (sample_all_lights && !use_light_tree) {
@@ -213,8 +214,8 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg,
                      light_u,
                      light_v,
                      sd->time,
-                     ray->P + ray->D * ray->t,
-                     -ray->D,
+                     sd->P_pick,
+                     sd->N_pick,
                      ray->t,
                      state->bounce,
                      &ls);
diff --git a/release/datafiles/locale b/release/datafiles/locale
index f1ab6e28bf1..4af22e0492f 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit f1ab6e28bf1626daf898fc65e144f1e4e4f2098a
+Subproject commit 4af22e0492f401c609a0203cad1a9bc7fa00b863
diff --git a/release/scripts/addons b/release/scripts/addons
index f1f69a63e0f..25b00a0a52c 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit f1f69a63e0fb0f3079a9895e34aa56ae9b070789
+Subproject commit 25b00a0a52c81408b9dc15ea320a79ee956b3c0a
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 45aa940dabd..f2f4a8b3bfa 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 45aa940dabda64f7877c6d5dd843998a86f0a836
+Subproject commit f2f4a8b3bfa36ee49f7bdb3a1acb40ef4b39ee3a
diff --git a/source/tools b/source/tools
index 5cf2fc3e5dc..6a252de776d 160000
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit 5cf2fc3e5dc28025394b57d8743401295528f310
+Subproject commit 6a252de776d0b9dca3167c30a7621a4f1e9bc911



More information about the Bf-blender-cvs mailing list