diff options
author | Thomas Dinges <blender@dingto.org> | 2013-08-30 22:04:23 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-08-30 22:04:23 +0400 |
commit | 499bec2a85f892f170ab46c97a0f268ee5acdc0a (patch) | |
tree | 11554d2b4a8825bd2651e5e710bee70742a143e0 | |
parent | a51f8e4353d908af660b746a23bc27e3dce1d89a (diff) |
Fix for [#36610] The new sky model produces strange results
* Clamp theta sky coordinates, to prevent a negative solarElevation.
Note: This means that you cannot get absolute night with the new model, but this is not supported anyway. So when you reach the maximum sunset, use the World Strength to further decrease the light.
-rw-r--r-- | intern/cycles/render/nodes.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 676b628f458..a9c17c8bcd5 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -464,6 +464,9 @@ static void sky_texture_precompute_new(SunSky *sunsky, float3 dir, float turbidi float2 spherical = sky_spherical_coordinates(dir); float theta = spherical.x; float phi = spherical.y; + + /* Clamp to Horizon */ + theta = clamp(theta, 0.0f, M_PI_2_F); sunsky->theta = theta; sunsky->phi = phi; |