diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-02-28 19:33:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-02-28 19:33:06 +0300 |
commit | 87f236cd10d8a0bc03fa775114d51e8a6a82d3fe (patch) | |
tree | 2c4114df2f5ecdac4a22028fa858abd1717a2037 | |
parent | efe78d824e549a16d974a9df90ade6b74b6d6a7a (diff) |
Cycles: Fix division by zero in volume code which was producing -nan
-rw-r--r-- | intern/cycles/kernel/kernel_volume.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_volume.h b/intern/cycles/kernel/kernel_volume.h index c7cb29b5af2..10d0d185345 100644 --- a/intern/cycles/kernel/kernel_volume.h +++ b/intern/cycles/kernel/kernel_volume.h @@ -966,7 +966,7 @@ ccl_device VolumeIntegrateResult kernel_volume_decoupled_scatter( mis_weight = 2.0f*power_heuristic(pdf, distance_pdf); } } - if(sample_t < 1e-6f) { + if(sample_t < 1e-6f || pdf == 0.0f) { return VOLUME_PATH_SCATTERED; } |