Fix #146632: Multiple Scattering Sky has dark pixels near the horizon
Avoid sqrt of a negative number. Pull Request: https://projects.blender.org/blender/blender/pulls/146718
This commit is contained in:
committed by
Brecht Van Lommel
parent
fff8d35e3f
commit
8e9ccb33d0
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user