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

Initialize alpha with lower bound to avoid NaN #274

Closed shadeops closed 4 years ago

shadeops commented 4 years ago

This provides a fix for Issue #273

Alpha is used as a divisor in the TrowbridgeReitzDistribution and BeckmannDistribution so we initialize to a lower bound of 0.001.

This value was choosen as its less than the RoughnessToAlpha()'s lower bound and matches the bound in the Disney material.

mmp commented 4 years ago

Thanks!