1
1

Cycles: don't allow negative BSDF weights

This doesn't work with path guiding, and likely other features.
This commit is contained in:
2022-09-20 20:58:07 +02:00
parent ed6c8d82b8
commit 9df0d20957

View File

@@ -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