diff --git a/src/luminaires/envmap.cpp b/src/luminaires/envmap.cpp index 90f8884f..e61ebf4d 100644 --- a/src/luminaires/envmap.cpp +++ b/src/luminaires/envmap.cpp @@ -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); }