Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/kernel/shaders/node_clamp.osl')
-rw-r--r--intern/cycles/kernel/shaders/node_clamp.osl8
1 files changed, 6 insertions, 2 deletions
diff --git a/intern/cycles/kernel/shaders/node_clamp.osl b/intern/cycles/kernel/shaders/node_clamp.osl
index 87dc1ccdb12..d689ba7f809 100644
--- a/intern/cycles/kernel/shaders/node_clamp.osl
+++ b/intern/cycles/kernel/shaders/node_clamp.osl
@@ -16,7 +16,11 @@
#include "stdosl.h"
-shader node_clamp(float Value = 1.0, float Min = 0.0, float Max = 1.0, output float Result = 0.0)
+shader node_clamp(string type = "minmax",
+ float Value = 1.0,
+ float Min = 0.0,
+ float Max = 1.0,
+ output float Result = 0.0)
{
- Result = clamp(Value, Min, Max);
+ Result = (type == "range" && (Min > Max)) ? clamp(Value, Max, Min) : clamp(Value, Min, Max);
}