[Bf-blender-cvs] [90bcc809322] soc-2022-many-lights-sampling: Fix PDF calculations for Many Lights Sampling

Brecht Van Lommel noreply at git.blender.org
Tue Sep 13 17:53:59 CEST 2022


Commit: 90bcc809322da426e59129aa21b13e2117173f69
Author: Brecht Van Lommel
Date:   Tue Sep 13 17:48:11 2022 +0200
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB90bcc809322da426e59129aa21b13e2117173f69

Fix PDF calculations for Many Lights Sampling

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D15951

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

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

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

diff --git a/intern/cycles/kernel/light/light_tree.h b/intern/cycles/kernel/light/light_tree.h
index 32da3f5bf29..f5eb4347492 100644
--- a/intern/cycles/kernel/light/light_tree.h
+++ b/intern/cycles/kernel/light/light_tree.h
@@ -561,6 +561,7 @@ ccl_device float light_tree_pdf(
           const int leaf_emitter = -knode->child_index + i;
           float light_importance = light_tree_emitter_importance(kg, P, N, leaf_emitter);
           if (leaf_emitter == emitter) {
+            selected_light = leaf_emitter;
             light_weight = light_tree_emitter_reservoir_weight(kg, P, N, selected_light);
             target_weight = light_weight;
             target_emitter_importance = light_importance;



More information about the Bf-blender-cvs mailing list