mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.86k stars 1.18k forks source link

NaNs in BeckmannDistribution and TrowbridgeReitzDistribution #273

Closed shadeops closed 4 years ago

shadeops commented 4 years ago

Both the BeckmannDistribution and TrowbridgeReitzDistribution divide by the anisotropic alpha values which can result in NaNs if either of those alpha values are 0. This can arise in the following condition:

An example is attached -

remap_glass_crash.pbrt.gz

mmp commented 4 years ago

Thanks!