[Bf-blender-cvs] [27da23de710] soc-2022-many-lights-sampling: Fix: support negative power in light tree

Jeffrey Liu noreply at git.blender.org
Tue Aug 23 22:27:53 CEST 2022


Commit: 27da23de710b5b8132836c79113cd5f19d3557d4
Author: Jeffrey Liu
Date:   Tue Aug 23 15:26:36 2022 -0500
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB27da23de710b5b8132836c79113cd5f19d3557d4

Fix: support negative power in light tree

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

M	intern/cycles/scene/light_tree.cpp

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

diff --git a/intern/cycles/scene/light_tree.cpp b/intern/cycles/scene/light_tree.cpp
index ecbf6bcb8cf..5ef5a4ad4ab 100644
--- a/intern/cycles/scene/light_tree.cpp
+++ b/intern/cycles/scene/light_tree.cpp
@@ -62,10 +62,6 @@ OrientationBounds merge(const OrientationBounds& cone_a,
   }
 }
 
-/* to-do: right now, this is assuming that the primitive is a point light.
- * The plan is to progressively add support for more primitives. 
- * Some of the logic is different from the past GSoC work, so 
- * will have to see which logic is more correct. */
 BoundBox LightTreePrimitive::calculate_bbox(Scene *scene) const
 {
   BoundBox bbox = BoundBox::empty;
@@ -229,7 +225,7 @@ float LightTreePrimitive::calculate_energy(Scene *scene) const
     strength = lamp->get_strength();
   }
 
-  return scene->shader_manager->linear_rgb_to_gray(strength);
+  return fabsf(scene->shader_manager->linear_rgb_to_gray(strength));
 }
 
 void LightTreeBuildNode::init_leaf(



More information about the Bf-blender-cvs mailing list