1uniform float u_Depth;
2uniform mat4 u_Color;
3varying vec2 v_TexCoord;
4varying vec2 v_TexCoord2;
5uniform sampler2D u_Tex0;
6uniform vec2 u_Resolution;
7uniform float u_Time;
8
9float random(in float a, in float b) { return fract((cos(dot(vec2(a,b) ,vec2(12.9898,78.233))) * 43758.5453)); }
10
11void main()
12{
13 gl_FragColor = texture2D(u_Tex0, v_TexCoord);
14 vec4 texcolor = texture2D(u_Tex0, v_TexCoord2);
15 if(texcolor.r > 0.9) {
16 gl_FragColor *= texcolor.g > 0.9 ? u_Color[0] : u_Color[1];
17 } else if(texcolor.g > 0.9) {
18 gl_FragColor *= u_Color[2];
19 } else if(texcolor.b > 0.9) {
20 gl_FragColor *= u_Color[3];
21 }
22
23 vec2 pos = v_TexCoord;
24
25 vec3 col;
26
27 col.r = texture2D(u_Tex0, vec2(pos.x + 0.015 * sin(0.02 * mod(u_Time, 3600.0)), pos.y)).x;
28 col.g = texture2D(u_Tex0, vec2(pos.x , pos.y)).y;
29 col.b = texture2D(u_Tex0, vec2(pos.x - 0.015 * sin(0.02 * mod(u_Time, 3600.0)), pos.y)).z;
30
31 float c = 1.;
32
33 c += 6. * sin(mod(u_Time, 3600.0) * 4. + pos.y * 1000.);
34 c += 3. * sin(mod(u_Time, 3600.0) * 1. + pos.y * 800.);
35 c += 20. * sin(mod(u_Time, 3600.0) * 10. + pos.y * 9000.);
36
37 c += 1. * cos(mod(u_Time, 3600.0) * 1. + pos.x * 1.);
38
39 pos += u_Time;
40
41 float r = random(pos.x, pos.y);
42 float g = random(pos.x * 9., pos.y * 9.);
43 float b = random(pos.x * 3., pos.y * 3.);
44
45 gl_FragColor *= vec4(col.x * r*c * .35, col.y * b * c * .35, col.z * g * c * .35, 1);
46 if(gl_FragColor.a < 0.01) discard;
47}