Fix [#36822], Sky Turbidity values > 10 could result in weird behavior and crashes...
authorThomas Dinges <blender@dingto.org>
Fri, 27 Sep 2013 10:26:00 +0000 (10:26 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 27 Sep 2013 10:26:00 +0000 (10:26 +0000)
Soft UI range is 10 already, now clamp inside the code as well.

intern/cycles/render/nodes.cpp

index 35b8a151587affe2377b6b3bae5555351ae9bfb4..621d52bbbbf371208f773d1af20f1cbb030ecec0 100644 (file)
@@ -520,6 +520,9 @@ static void sky_texture_precompute_new(SunSky *sunsky, float3 dir, float turbidi
        float theta = spherical.x;
        float phi = spherical.y;
        
        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); 
 
        /* Clamp to Horizon */
        theta = clamp(theta, 0.0f, M_PI_2_F);