Fix [#36822], Sky Turbidity values > 10 could result in weird behavior and crashes...
[blender.git] / 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;
        
+       /* Clamp Turbidity */
+       turbidity = clamp(turbidity, 0.0f, 10.0f); 
+       
        /* Clamp to Horizon */
        theta = clamp(theta, 0.0f, M_PI_2_F);