#include scene_sessions24/util.glsl

// float sine_ease(float n) {
//     return sin(n*PI-PI/2.0)*0.5+0.5;
// }

vec2 tanstretch_main(vec2 UV, float t) {
    float i_t = fract(floor(t) / 4.0)*4.0;
    float f_t = fract(t*0.5);

    float factor = (f_t>0.5?1.0-f_t:f_t)*4.0-1.0;
    factor = pow(factor, 3.0);
    factor = factor*0.5+0.5;
    vec2 p = UV;
    p/=vec2(factor,1.0-factor)+.05;

    return p+i_t*1.0;
}