From d0a092be5c8069d4b56a558868eff2912a714307 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 27 Sep 2013 10:26:00 +0000 Subject: [PATCH] Fix [#36822], Sky Turbidity values > 10 could result in weird behavior and crashes with the new sky model. Soft UI range is 10 already, now clamp inside the code as well. --- intern/cycles/render/nodes.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 35b8a151587..621d52bbbbf 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -520,6 +520,9 @@ static void sky_texture_precompute_new(SunSky *sunsky, float3 dir, float turbidi float theta = spherical.x; float phi = spherical.y; + /* Clamp Turbidity */ + turbidity = clamp(turbidity, 0.0f, 10.0f); + /* Clamp to Horizon */ theta = clamp(theta, 0.0f, M_PI_2_F);