diff options
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.glsl | 5 |
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 b196aed690f..f89608feff1 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl @@ -3,6 +3,11 @@ void clamp_value(float value, float min, float max, out float result) result = clamp(value, min, max); } +void clamp_minmax(float value, float min_allowed, float max_allowed, out float result) +{ + result = min(max(value, min_allowed), max_allowed); +} + void clamp_range(float value, float min, float max, out float result) { result = (max > min) ? clamp(value, min, max) : clamp(value, max, min); |