Cleanup: Spelling in Cycles light tree
Pull Request: https://projects.blender.org/blender/blender/pulls/108324
This commit is contained in:
committed by
Sergey Sharybin
parent
cc25a37bee
commit
82e8f1129c
@@ -498,12 +498,12 @@ ccl_device void light_tree_child_importance(KernelGlobals kg,
|
||||
}
|
||||
}
|
||||
|
||||
ccl_device void sample_resevoir(const int current_index,
|
||||
const float current_weight,
|
||||
ccl_private int &selected_index,
|
||||
ccl_private float &selected_weight,
|
||||
ccl_private float &total_weight,
|
||||
ccl_private float &rand)
|
||||
ccl_device void sample_reservoir(const int current_index,
|
||||
const float current_weight,
|
||||
ccl_private int &selected_index,
|
||||
ccl_private float &selected_weight,
|
||||
ccl_private float &total_weight,
|
||||
ccl_private float &rand)
|
||||
{
|
||||
if (current_weight == 0.0f) {
|
||||
return;
|
||||
@@ -522,7 +522,7 @@ ccl_device void sample_resevoir(const int current_index,
|
||||
return;
|
||||
}
|
||||
|
||||
/* Pick an emitter from a leaf node using resevoir sampling, keep two reservoirs for upper and
|
||||
/* Pick an emitter from a leaf node using reservoir sampling, keep two reservoirs for upper and
|
||||
* lower bounds. */
|
||||
template<bool in_volume_segment>
|
||||
ccl_device int light_tree_cluster_select_emitter(KernelGlobals kg,
|
||||
@@ -540,7 +540,7 @@ ccl_device int light_tree_cluster_select_emitter(KernelGlobals kg,
|
||||
const ccl_global KernelLightTreeNode *knode = &kernel_data_fetch(light_tree_nodes, *node_index);
|
||||
*node_index = -1;
|
||||
|
||||
/* Mark emitters with zero importance. Used for resevoir when total minimum importance = 0. */
|
||||
/* Mark emitters with zero importance. Used for reservoir when total minimum importance = 0. */
|
||||
kernel_assert(knode->num_emitters <= sizeof(uint) * 8);
|
||||
uint has_importance = 0;
|
||||
|
||||
@@ -556,12 +556,12 @@ ccl_device int light_tree_cluster_select_emitter(KernelGlobals kg,
|
||||
light_tree_emitter_importance<in_volume_segment>(
|
||||
kg, P, N_or_D, t, has_transmission, current_index, importance[0], importance[1]);
|
||||
|
||||
sample_resevoir(current_index,
|
||||
importance[!sample_max],
|
||||
selected_index,
|
||||
selected_importance[!sample_max],
|
||||
total_importance[!sample_max],
|
||||
rand);
|
||||
sample_reservoir(current_index,
|
||||
importance[!sample_max],
|
||||
selected_index,
|
||||
selected_importance[!sample_max],
|
||||
total_importance[!sample_max],
|
||||
rand);
|
||||
if (selected_index == current_index) {
|
||||
selected_importance[sample_max] = importance[sample_max];
|
||||
}
|
||||
@@ -584,12 +584,12 @@ ccl_device int light_tree_cluster_select_emitter(KernelGlobals kg,
|
||||
selected_index = -1;
|
||||
for (int i = 0; i < knode->num_emitters; i++) {
|
||||
int current_index = knode->leaf.first_emitter + i;
|
||||
sample_resevoir(current_index,
|
||||
float(has_importance & 1),
|
||||
selected_index,
|
||||
selected_importance[1],
|
||||
total_importance[1],
|
||||
rand);
|
||||
sample_reservoir(current_index,
|
||||
float(has_importance & 1),
|
||||
selected_index,
|
||||
selected_importance[1],
|
||||
total_importance[1],
|
||||
rand);
|
||||
has_importance >>= 1;
|
||||
}
|
||||
|
||||
@@ -730,7 +730,7 @@ ccl_device_noinline bool light_tree_sample(KernelGlobals kg,
|
||||
float discard;
|
||||
float total_prob = left_prob;
|
||||
node_index = left_index;
|
||||
sample_resevoir(
|
||||
sample_reservoir(
|
||||
right_index, 1.0f - left_prob, node_index, discard, total_prob, rand_selection);
|
||||
pdf_leaf *= (node_index == left_index) ? left_prob : (1.0f - left_prob);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user