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 'source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl
index b8842064b6f..b196aed690f 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl
@@ -2,3 +2,8 @@ void clamp_value(float value, float min, float max, out float result)
{
result = clamp(value, min, max);
}
+
+void clamp_range(float value, float min, float max, out float result)
+{
+ result = (max > min) ? clamp(value, min, max) : clamp(value, max, min);
+}