aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/ReliefTunnel.frag.glsl
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-06-19 15:56:23 -0700
committerNivesh Rajbhandari2012-06-19 15:56:23 -0700
commit3ed06c2a55b1ae840334efeb47f7743944ecb3ca (patch)
tree0ad3e94248a1d4828386c8743a670c709357a470 /assets/shaders/ReliefTunnel.frag.glsl
parenta0d18963d746e410511c29edd32bc1775d2d5851 (diff)
parent483ad57efcd6475776f580c3af5b60e6deeaf781 (diff)
downloadninja-3ed06c2a55b1ae840334efeb47f7743944ecb3ca.tar.gz
Merge branch 'refs/heads/ninja-internal' into GIO_Fixes
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;