diff options
author | Armen Kesablyan | 2012-06-20 15:00:34 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-20 15:00:34 -0700 |
commit | 38f571d1fdf02d36c3816637af7b2ca2493809da (patch) | |
tree | 69b97839be8b2b6fb65e9150d4dc02856041fb1d /assets/shaders/Mandel.frag.glsl | |
parent | f7c14e54c52bce8875cde81db621dde6f4ff1e34 (diff) | |
parent | 120e31dcf1e11eed11ee430d77c438e7b073e9f8 (diff) | |
download | ninja-38f571d1fdf02d36c3816637af7b2ca2493809da.tar.gz |
Merge branch 'refs/heads/master' into binding
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; |