-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.glsl
58 lines (54 loc) · 1.29 KB
/
example.glsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
// Created by S.Guillitte
uniform float u_time;
uniform vec2 u_resolution;
void main()
{
float time=u_time*1.0;
vec2 uv = (gl_FragCoord.xy / u_resolution.xx-0.5)*8.0;
vec2 uv0=uv;
float i0=1.0;
float i1=1.0;
float i2=1.0;
float i4=0.0;
for(int s=0;s<7;s++)
{
vec2 r;
r=vec2(cos(uv.y*i0-i4+time/i1),sin(uv.x*i0-i4+time/i1))/i2;
r+=vec2(-r.y,r.x)*0.3;
uv.xy+=r;
i0*=1.93;
i1*=1.15;
i2*=1.7;
i4+=0.05+0.1*time*i1;
}
float r=sin(uv.x-time)*0.5+0.5;
float b=sin(uv.y+time)*0.5+0.5;
float g=sin((uv.x+uv.y+sin(time*0.5))*0.5)*0.5+0.5;
gl_FragColor = vec4(r,g,b,1.0);
}
// void main()
// {
// float time=iGlobalTime*1.0;
// vec2 uv = (gl_FragCoord.xy / iResolution.xx-0.5)*8.0;
// vec2 uv0=uv;
// float i0=1.0;
// float i1=1.0;
// float i2=1.0;
// float i4=0.0;
// for(int s=0;s<7;s++)
// {
// vec2 r;
// r=vec2(cos(uv.y*i0-i4+time/i1),sin(uv.x*i0-i4+time/i1))/i2;
// r+=vec2(-r.y,r.x)*0.3;
// uv.xy+=r;
// i0*=1.93;
// i1*=1.15;
// i2*=1.7;
// i4+=0.05+0.1*time*i1;
// }
// float r=sin(uv.x-time)*0.5+0.5;
// float b=sin(uv.y+time)*0.5+0.5;
// float g=sin((uv.x+uv.y+sin(time*0.5))*0.5)*0.5+0.5;
// gl_FragColor = vec4(r,g,b,1.0);
// }