diff options
author | Eric Guzman | 2012-06-20 19:42:03 -0700 |
---|---|---|
committer | Eric Guzman | 2012-06-20 19:42:03 -0700 |
commit | 3270aac4980c908f305fb53abadda5121ff6b9cb (patch) | |
tree | 6255aaab239fde71b1f4862dd70de7be62f48b85 /assets/shaders/Mandel.frag.glsl | |
parent | a5d93daf6fdccbfee160d6a8ba08f6b6d4b9d7cc (diff) | |
parent | 87377c81da06abf6d656017859830a3ab2902f0e (diff) | |
download | ninja-3270aac4980c908f305fb53abadda5121ff6b9cb.tar.gz |
Merge branch 'binding' of github.com:dhg637/ninja-internal 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; |