This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/shaders/material/gpu_shader_material_clamp.glsl

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
404 B
GLSL
Raw Normal View History

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);
}