aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Fly.frag.glsl
blob: d36928a1c04728952e753541fb5880011f788c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifdef GL_ES
precision highp float;
#endif

uniform vec2 u_resolution;
uniform float u_time;
uniform float u_speed;
uniform sampler2D u_tex0;

void main(void)
{
    vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy;
    vec2 uv;

    float an = u_time*u_speed*.25;

    float x = p.x*cos(an)-p.y*sin(an);
    float y = p.x*sin(an)+p.y*cos(an);
     
    uv.x = .25*x/abs(y);
    uv.y = .20*u_time*u_speed + .25/abs(y);

    gl_FragColor = vec4(texture2D(u_tex0,uv).xyz * y*y, 1.0);
}