aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Mandel.frag.glsl
diff options
context:
space:
mode:
authorEric Guzman2012-06-20 19:42:03 -0700
committerEric Guzman2012-06-20 19:42:03 -0700
commit3270aac4980c908f305fb53abadda5121ff6b9cb (patch)
tree6255aaab239fde71b1f4862dd70de7be62f48b85 /assets/shaders/Mandel.frag.glsl
parenta5d93daf6fdccbfee160d6a8ba08f6b6d4b9d7cc (diff)
parent87377c81da06abf6d656017859830a3ab2902f0e (diff)
downloadninja-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.glsl9
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
5uniform vec2 u_resolution; 5uniform vec2 u_resolution;
6uniform float u_time; 6uniform float u_time;
7uniform float u_speed;
7 8
8void main(void) 9void 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;