aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/ReliefTunnel.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/ReliefTunnel.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/ReliefTunnel.frag.glsl')
-rw-r--r--assets/shaders/ReliefTunnel.frag.glsl7
1 files changed, 5 insertions, 2 deletions
diff --git a/assets/shaders/ReliefTunnel.frag.glsl b/assets/shaders/ReliefTunnel.frag.glsl
index cee707db..5bd727cf 100644
--- a/assets/shaders/ReliefTunnel.frag.glsl
+++ b/assets/shaders/ReliefTunnel.frag.glsl
@@ -4,6 +4,7 @@ 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;
7uniform sampler2D u_tex0; 8uniform sampler2D u_tex0;
8 9
9void main(void) 10void main(void)
@@ -11,8 +12,10 @@ void main(void)
11 vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; 12 vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy;
12 vec2 uv; 13 vec2 uv;
13 14
15 float time = u_time * u_speed;
16
14 float r = sqrt( dot(p,p) ); 17 float r = sqrt( dot(p,p) );
15 float a = atan(p.y,p.x) + 0.5*sin(0.5*r-0.5*u_time); 18 float a = atan(p.y,p.x) + 0.5*sin(0.5*r-0.5*time);
16 19
17 float s = 0.5 + 0.5*cos(7.0*a); 20 float s = 0.5 + 0.5*cos(7.0*a);
18 s = smoothstep(0.0,1.0,s); 21 s = smoothstep(0.0,1.0,s);
@@ -20,7 +23,7 @@ void main(void)
20 s = smoothstep(0.0,1.0,s); 23 s = smoothstep(0.0,1.0,s);
21 s = smoothstep(0.0,1.0,s); 24 s = smoothstep(0.0,1.0,s);
22 25
23 uv.x = u_time + 1.0/( r + .2*s); 26 uv.x = time + 1.0/( r + .2*s);
24 uv.y = 3.0*a/3.1416; 27 uv.y = 3.0*a/3.1416;
25 28
26 float w = (0.5 + 0.5*s)*r*r; 29 float w = (0.5 + 0.5*s)*r*r;