EEVEE: Fix sky zenith bug
Careless use of acos() in spherical coordinates transformation was deteriorating the precision near zenith (and nadir) and producing glitchy pixels (best seen in longer focal lengths). Reviewed By: fclem Differential Revision: https://developer.blender.org/D8266
This commit is contained in:
parent
16989c4d1d
commit
29da019cb3
|
@ -14,7 +14,7 @@ float sky_angle_between(float thetav, float phiv, float theta, float phi)
|
|||
|
||||
vec3 sky_spherical_coordinates(vec3 dir)
|
||||
{
|
||||
return vec3(acos(dir.z), atan(dir.x, dir.y), 0);
|
||||
return vec3(M_PI_2 - atan(dir.z, length(dir.xy)), atan(dir.x, dir.y), 0);
|
||||
}
|
||||
|
||||
/* Preetham */
|
||||
|
|
Loading…
Reference in New Issue