aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/ReliefTunnel.frag.glsl
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-20 15:00:19 -0700
committerArmen Kesablyan2012-06-20 15:00:19 -0700
commit120e31dcf1e11eed11ee430d77c438e7b073e9f8 (patch)
tree8c07b1203de42f6efdeebfc8663072fffb4a567b /assets/shaders/ReliefTunnel.frag.glsl
parentc59eb371559a3061ce53223e249ca97daace5968 (diff)
parent52833c3d8a485944c42acc6ac0ae5139b3427da8 (diff)
downloadninja-120e31dcf1e11eed11ee430d77c438e7b073e9f8.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
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;