Fix for #35591:
authorThomas Dinges <blender@dingto.org>
Sat, 1 Jun 2013 12:23:49 +0000 (12:23 +0000)
committerThomas Dinges <blender@dingto.org>
Sat, 1 Jun 2013 12:23:49 +0000 (12:23 +0000)
* Cycles Mix closure could render strange effects, when the user entered a value out of the 0...1 range. This was already clamped for OSL, clamp for SVM as well.

intern/cycles/kernel/svm/svm_closure.h

index 0621133a31652550554cb3ca3f89c6bfd902ed8d..bf9823aa53e7746d7bc6203f3e0e8b17b12809dd 100644 (file)
@@ -599,6 +599,8 @@ __device void svm_node_mix_closure(ShaderData *sd, float *stack,
        decode_node_uchar4(node.y, &weight_offset, &in_weight_offset, &weight1_offset, &weight2_offset);
 
        float weight = stack_load_float(stack, weight_offset);
+       weight = clamp(weight, 0.0f, 1.0f);
+
        float in_weight = (stack_valid(in_weight_offset))? stack_load_float(stack, in_weight_offset): 1.0f;
 
        if(stack_valid(weight1_offset))