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

gpu_shader_material_clamp.glsl « material « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f89608feff12ba3e363e16b780271064cef1c2cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
}