aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Keleidoscope.frag.glsl
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-06-19 10:25:16 -0700
committerJose Antonio Marquez2012-06-19 10:25:16 -0700
commit4d2a5acd1631f0cf4e38f127c886f481668ddce0 (patch)
tree3bc8f2b21826c0ee6d37bc77753d45a882783cbf /assets/shaders/Keleidoscope.frag.glsl
parent616b31a644ee221edcbc19f821b2194e8edf9fad (diff)
parent483ad57efcd6475776f580c3af5b60e6deeaf781 (diff)
downloadninja-4d2a5acd1631f0cf4e38f127c886f481668ddce0.tar.gz
Merge branch 'refs/heads/Ninja-Internal' into FileIO
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