diff --git a/intern/sky/source/sky_multiple_scattering.cpp b/intern/sky/source/sky_multiple_scattering.cpp index 0c20b80686d..e0e00731c8b 100644 --- a/intern/sky/source/sky_multiple_scattering.cpp +++ b/intern/sky/source/sky_multiple_scattering.cpp @@ -241,7 +241,7 @@ class SkyMultipleScattering { inline float4 lookup_multiscattering(float cos_theta, float normalized_height, float d) const { /* Solid angle subtended by the planet from a point at d distance from the planet center. */ - const float omega = M_2PI_F * (1.0f - sqrtf(1.0f - sqr(EARTH_RADIUS / d))); + const float omega = M_2PI_F * (1.0f - safe_sqrtf(1.0f - sqr(EARTH_RADIUS / d))); const float4 T_to_ground = lookup_transmittance_at_ground(cos_theta); /* We can split the path into Ground <-> Sample <-> Sun. * The LUT gives us both T(Sample,Sun) and T(Ground,Sun) = T(Ground,Sample)*T(Sample,Sun),