diff --git a/src/librender/kdtree.cpp b/src/librender/kdtree.cpp index 46a0f518..a19253c4 100644 --- a/src/librender/kdtree.cpp +++ b/src/librender/kdtree.cpp @@ -113,8 +113,8 @@ bool KDTree::rayIntersect(const Ray &ray, Intersection &its) const { /* Use an adaptive ray epsilon */ Float rayMinT = ray.mint; if (rayMinT == Epsilon) - rayMinT *= std::max(std::max(std::abs(ray.o.x), - std::abs(ray.o.y)), std::abs(ray.o.z)); + rayMinT *= std::max(std::max(std::max(std::abs(ray.o.x), + std::abs(ray.o.y)), std::abs(ray.o.z)), Epsilon); if (rayMinT > mint) mint = rayMinT; if (ray.maxt < maxt) maxt = ray.maxt;