Cycles: don't allow negative BSDF weights
This doesn't work with path guiding, and likely other features.
This commit is contained in:
@@ -53,6 +53,9 @@ ccl_device_inline ccl_private ShaderClosure *bsdf_alloc(ccl_private ShaderData *
|
||||
{
|
||||
kernel_assert(isfinite_safe(weight));
|
||||
|
||||
/* No negative weights allowed. */
|
||||
weight = max(weight, zero_float3());
|
||||
|
||||
const float sample_weight = fabsf(average(weight));
|
||||
|
||||
/* Use comparison this way to help dealing with non-finite weight: if the average is not finite
|
||||
|
Reference in New Issue
Block a user