Fix T50975: Cycles: Light sampling threshold inadvertently clamps negative lamps

This commit is contained in:
Sergey Sharybin 2017-03-20 14:48:37 +01:00
parent 6b86b446d3
commit a201b99c5a
Notes: blender-bot 2023-02-14 07:08:22 +01:00
Referenced by issue #50975, Cycles: Light sampling threshold inadvertently clamps negative lamps
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ ccl_device_noinline bool direct_emission(KernelGlobals *kg,
return false;
if(kernel_data.integrator.light_inv_rr_threshold > 0.0f) {
float probability = max3(bsdf_eval_sum(eval)) * kernel_data.integrator.light_inv_rr_threshold;
float probability = max3(fabs(bsdf_eval_sum(eval))) * kernel_data.integrator.light_inv_rr_threshold;
if(probability < 1.0f) {
if(rand_terminate >= probability) {
return false;