Modes: Linear interpolation (default), stepped linear, smoothstep and smootherstep. This also includes an additional option for the **Clamp node** to switch between **Min Max** (default) and **Range** mode. This was needed to allow clamping when **To Max** is less than **To Min**. Reviewed By: JacquesLucke, brecht Differential Revision: https://developer.blender.org/D5827
10 lines
258 B
GLSL
10 lines
258 B
GLSL
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);
|
|
}
|