further restricted roughness range to prevent numerical overflow issues on single precision

metadata
Wenzel Jakob 2013-01-31 21:19:28 -05:00
parent 47c175a598
commit c4045a1066
1 changed files with 5 additions and 1 deletions

View File

@ -84,7 +84,11 @@ public:
* (For lower roughness values, please switch to the smooth BSDF variants)
*/
Float transformRoughness(Float value) const {
value = std::max(value, (Float) 1e-5f);
#if defined(SINGLE_PRECISION)
value = std::max(value, (Float) 1e-3f);
#else
value = std::max(value, (Float) 1e-5f);
#endif
if (m_type == EPhong || m_type == EAshikhminShirley)
value = std::max(2 / (value * value) - 2, (Float) 0.1f);
return value;