#pragma header

uniform float iTime;
uniform float u_ratio;

float noise2d(vec2 co){
    return fract(sin(dot(co.xy ,vec2(1.0,73))) * 43758.5453);
}

void main()
{
    vec2 uv = openfl_TextureCoordv;

    uv = uv * sin(iTime);

    vec3 noise_tex = vec3(noise2d(uv));

    vec4 tex = flixel_texture2D(bitmap, openfl_TextureCoordv);

    tex.rgb = mix(tex.rgb, noise_tex, u_ratio);

    gl_FragColor = tex;
    
}