fuckingtech/public/assets/glsl/lygia/animation/easing/cubicInOut.glsl
Elias Rhouzlane bf76c6b086 fix: code
2025-04-06 17:23:52 +02:00

16 lines
455 B
GLSL

/*
contributors: Hugh Kennedy (https://github.com/hughsk)
description: Cubic in/out easing. From https://github.com/stackgl/glsl-easings
use: cubicInOut(<float> x)
examples:
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
*/
#ifndef FNC_CUBICINOUT
#define FNC_CUBICINOUT
float cubicInOut(in float t) {
return t < 0.5
? 4.0 * t * t * t
: 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;
}
#endif