fuckingtech/public/assets/glsl/lygia/math/saturate.msl 2
Elias Rhouzlane bf76c6b086 fix: code
2025-04-06 17:23:52 +02:00

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