diff options
Diffstat (limited to 'assets/shaders/Mandel.frag.glsl')
-rw-r--r-- | assets/shaders/Mandel.frag.glsl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/assets/shaders/Mandel.frag.glsl b/assets/shaders/Mandel.frag.glsl index 6465899d..62be76b9 100644 --- a/assets/shaders/Mandel.frag.glsl +++ b/assets/shaders/Mandel.frag.glsl | |||
@@ -4,15 +4,18 @@ precision highp float; | |||
4 | 4 | ||
5 | uniform vec2 u_resolution; | 5 | uniform vec2 u_resolution; |
6 | uniform float u_time; | 6 | uniform float u_time; |
7 | uniform float u_speed; | ||
7 | 8 | ||
8 | void main(void) | 9 | void main(void) |
9 | { | 10 | { |
10 | vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; | 11 | vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; |
11 | p.x *= u_resolution.x/u_resolution.y; | 12 | p.x *= u_resolution.x/u_resolution.y; |
12 | 13 | ||
13 | float zoo = .62+.38*sin(.1*u_time); | 14 | float time = u_time * u_speed; |
14 | float coa = cos( 0.1*(1.0-zoo)*u_time ); | 15 | |
15 | float sia = sin( 0.1*(1.0-zoo)*u_time ); | 16 | float zoo = .62+.38*sin(.1*time); |
17 | float coa = cos( 0.1*(1.0-zoo)*time ); | ||
18 | float sia = sin( 0.1*(1.0-zoo)*time ); | ||
16 | zoo = pow( zoo,8.0); | 19 | zoo = pow( zoo,8.0); |
17 | vec2 xy = vec2( p.x*coa-p.y*sia, p.x*sia+p.y*coa); | 20 | vec2 xy = vec2( p.x*coa-p.y*sia, p.x*sia+p.y*coa); |
18 | vec2 cc = vec2(-.745,.186) + xy*zoo; | 21 | vec2 cc = vec2(-.745,.186) + xy*zoo; |