aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Keleidoscope.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/Keleidoscope.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/Keleidoscope.frag.glsl')
-rw-r--r--assets/shaders/Keleidoscope.frag.glsl8
1 files changed, 6 insertions, 2 deletions
diff --git a/assets/shaders/Keleidoscope.frag.glsl b/assets/shaders/Keleidoscope.frag.glsl
index 7d1bdb17..7d95a95b 100644
--- a/assets/shaders/Keleidoscope.frag.glsl
+++ b/assets/shaders/Keleidoscope.frag.glsl
@@ -4,20 +4,24 @@ 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)
10{ 11{
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;
14
15 float time = u_time * u_speed;
13 16
14 float a = atan(p.y,p.x); 17 float a = atan(p.y,p.x);
15 float r = sqrt(dot(p,p)); 18 float r = sqrt(dot(p,p));
16 19
17 uv.x = 7.0*a/3.1416; 20 uv.x = 7.0*a/3.1416;
18 uv.y = -u_time+ sin(7.0*r+u_time) + .7*cos(u_time+7.0*a); 21 uv.y = -time + sin(7.0*r+time) + .7*cos(
22 +7.0*a);
19 23
20 float w = .5+.5*(sin(u_time+7.0*r)+ .7*cos(u_time+7.0*a)); 24 float w = .5+.5*(sin(time+7.0*r)+ .7*cos(time+7.0*a));
21 25
22 vec3 col = texture2D(u_tex0,uv*.5).xyz; 26 vec3 col = texture2D(u_tex0,uv*.5).xyz;
23 27