15 lines
No EOL
620 B
Text
15 lines
No EOL
620 B
Text
/*
|
|
contributors: Patricio Gonzalez Vivo
|
|
description: clamp a value between 0 and 1
|
|
use: <float|float2|float3|float4> saturation(<float|float2|float3|float4> value)
|
|
examples:
|
|
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/math_functions.frag
|
|
license:
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Prosperity License - https://prosperitylicense.com/versions/3.0.0
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Patron License - https://lygia.xyz/license
|
|
*/
|
|
|
|
#if !defined(FNC_SATURATE) && !defined(saturate)
|
|
#define FNC_SATURATE
|
|
#define saturate(V) clamp(V, 0.0, 1.0)
|
|
#endif |