further restricted roughness range to prevent numerical overflow issues on single precision
parent
47c175a598
commit
c4045a1066
|
@ -84,7 +84,11 @@ public:
|
||||||
* (For lower roughness values, please switch to the smooth BSDF variants)
|
* (For lower roughness values, please switch to the smooth BSDF variants)
|
||||||
*/
|
*/
|
||||||
Float transformRoughness(Float value) const {
|
Float transformRoughness(Float value) const {
|
||||||
|
#if defined(SINGLE_PRECISION)
|
||||||
|
value = std::max(value, (Float) 1e-3f);
|
||||||
|
#else
|
||||||
value = std::max(value, (Float) 1e-5f);
|
value = std::max(value, (Float) 1e-5f);
|
||||||
|
#endif
|
||||||
if (m_type == EPhong || m_type == EAshikhminShirley)
|
if (m_type == EPhong || m_type == EAshikhminShirley)
|
||||||
value = std::max(2 / (value * value) - 2, (Float) 0.1f);
|
value = std::max(2 / (value * value) - 2, (Float) 0.1f);
|
||||||
return value;
|
return value;
|
||||||
|
|
Loading…
Reference in New Issue