From c052ebda8e13df7dfb662a4ebb9fd42fbe74d23e Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 29 Aug 2012 17:30:14 +0000 Subject: Cycles bugfix: [32431] Cycles Math Node : Clamp does not work the OSL solution is slightly different than the svm, but I think it's fine. thanks Lukas Toenne for helping with a fix on the original patch --- intern/cycles/kernel/svm/svm_math.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'intern/cycles/kernel/svm/svm_math.h') diff --git a/intern/cycles/kernel/svm/svm_math.h b/intern/cycles/kernel/svm/svm_math.h index bc2f774097e..e39c7a4ba6c 100644 --- a/intern/cycles/kernel/svm/svm_math.h +++ b/intern/cycles/kernel/svm/svm_math.h @@ -108,6 +108,8 @@ __device float svm_math(NodeMath type, float Fac1, float Fac2) Fac = Fac1 < Fac2; else if(type == NODE_MATH_GREATER_THAN) Fac = Fac1 > Fac2; + else if(type == NODE_MATH_CLAMP) + Fac = clamp(Fac1, 0.0f, 1.0f); else Fac = 0.0f; -- cgit v1.2.3