fix a NaN issue in envmap.cpp

metadata
Wenzel Jakob 2011-07-28 12:09:56 +02:00
parent fcae6a3314
commit ff025d558f
1 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,8 @@ public:
Vector sampledDirection(sinTheta * sinPhi,
cosTheta, -sinTheta*cosPhi);
pdf = pdf / (m_pdfPixelSize.x * m_pdfPixelSize.y * sinTheta);
pdf = pdf / (m_pdfPixelSize.x * m_pdfPixelSize.y
* std::max(Epsilon, sinTheta));
return m_luminaireToWorld(-sampledDirection);
}