[Bf-blender-cvs] [4a43a148934] soc-2022-many-lights-sampling: Choosing between the light tree and the distant light group based on the total importance
Weizhen Huang
noreply at git.blender.org
Thu Nov 3 17:33:14 CET 2022
Commit: 4a43a148934fb97641c490a202fe3a1c76a3016b
Author: Weizhen Huang
Date: Thu Nov 3 14:52:37 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB4a43a148934fb97641c490a202fe3a1c76a3016b
Choosing between the light tree and the distant light group based on the total importance
Differential Revision: https://developer.blender.org/D16381
===================================================================
M intern/cycles/scene/light.cpp
===================================================================
diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp
index 20650759c29..65d4c76fa8c 100644
--- a/intern/cycles/scene/light.cpp
+++ b/intern/cycles/scene/light.cpp
@@ -386,7 +386,6 @@ void LightManager::device_update_distribution(Device *device,
KernelLightTreeNode *light_tree_nodes = dscene->light_tree_nodes.alloc(linearized_bvh.size());
KernelLightTreeEmitter *light_tree_emitters = dscene->light_tree_emitters.alloc(
light_prims.size());
- float max_light_tree_energy = 0.0f;
for (int index = 0; index < linearized_bvh.size(); index++) {
const PackedLightTreeNode &node = linearized_bvh[index];
@@ -415,9 +414,6 @@ void LightManager::device_update_distribution(Device *device,
float energy = prim.calculate_energy(scene);
light_tree_emitters[emitter_index].energy = energy;
- if (energy > max_light_tree_energy) {
- max_light_tree_energy = energy;
- }
for (int i = 0; i < 3; i++) {
light_tree_emitters[emitter_index].bounding_box_min[i] = bbox.min[i];
@@ -473,12 +469,6 @@ void LightManager::device_update_distribution(Device *device,
}
}
- /* We set the parent node's energy to be the average energy,
- * which is used for deciding between the tree and distant lights. */
- if (max_light_tree_energy > 0.0f) {
- light_tree_nodes[0].energy = max_light_tree_energy;
- }
-
/* We also add distant lights to a separate group. */
KernelLightTreeDistantEmitter *light_tree_distant_group =
dscene->light_tree_distant_group.alloc(num_distant_lights + 1);
More information about the Bf-blender-cvs
mailing list