[Bf-blender-cvs] [8d4fbfda26e] soc-2022-many-lights-sampling: Fix: resolve light tree compilation errors

Jeffrey Liu noreply at git.blender.org
Sun Sep 4 01:38:18 CEST 2022


Commit: 8d4fbfda26e74ea9c89869174f08819401a676fe
Author: Jeffrey Liu
Date:   Sat Sep 3 18:37:55 2022 -0500
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB8d4fbfda26e74ea9c89869174f08819401a676fe

Fix: resolve light tree compilation errors

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

M	intern/cycles/kernel/integrator/shade_background.h
M	intern/cycles/kernel/light/light_tree.h

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

diff --git a/intern/cycles/kernel/integrator/shade_background.h b/intern/cycles/kernel/integrator/shade_background.h
index 041a8df8e9d..2e0bbc4899d 100644
--- a/intern/cycles/kernel/integrator/shade_background.h
+++ b/intern/cycles/kernel/integrator/shade_background.h
@@ -121,7 +121,7 @@ ccl_device_inline void integrate_background(KernelGlobals kg,
 
       /* multiple importance sampling, get background light pdf for ray
        * direction, and compute weight with respect to BSDF pdf */
-      const float pdf = background_light_pdf(kg, ray_P, ray_D);
+      float pdf = background_light_pdf(kg, ray_P, ray_D);
       if (kernel_data.integrator.use_light_tree) {
         const float3 N = INTEGRATOR_STATE(state, path, mis_origin_n);
         pdf *= distant_lights_pdf(kg, ray_P, N, kernel_data.background.light_index);
diff --git a/intern/cycles/kernel/light/light_tree.h b/intern/cycles/kernel/light/light_tree.h
index efe3a746b6d..b265530e5e8 100644
--- a/intern/cycles/kernel/light/light_tree.h
+++ b/intern/cycles/kernel/light/light_tree.h
@@ -519,7 +519,8 @@ ccl_device float light_tree_pdf(KernelGlobals kg,
   /* We generate a random number to use for selecting a light. */
   RNGState rng_state;
   path_state_rng_load(state, &rng_state);
-  float randu = path_state_rng_1D_hash(kg, &rng_state, 0x6a21694c);
+  /* to-do: is this the correct macro to use? */
+  float randu = path_state_rng_1D(kg, &rng_state, PRNG_LIGHT); 
 
   /* We traverse to the leaf node and
    * find the probability of selecting the target light. */



More information about the Bf-blender-cvs mailing list