aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Star.frag.glsl
diff options
context:
space:
mode:
authorJonathan Duran2012-06-19 08:40:26 -0700
committerJonathan Duran2012-06-19 08:40:26 -0700
commit6f25a2e70079de6bcbb8c3411ddef88c2ed1ea39 (patch)
tree253e5f6dd5923218e3155f78fa67ff3e43de0ebc /assets/shaders/Star.frag.glsl
parentb51c9448bc187f9bfa3ab39c366657ec2bb9e2fb (diff)
parent483ad57efcd6475776f580c3af5b60e6deeaf781 (diff)
downloadninja-6f25a2e70079de6bcbb8c3411ddef88c2ed1ea39.tar.gz
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Diffstat (limited to 'assets/shaders/Star.frag.glsl')
-rw-r--r--assets/shaders/Star.frag.glsl11
1 files changed, 7 insertions, 4 deletions
diff --git a/assets/shaders/Star.frag.glsl b/assets/shaders/Star.frag.glsl
index f63fe605..f61f43c9 100644
--- a/assets/shaders/Star.frag.glsl
+++ b/assets/shaders/Star.frag.glsl
@@ -3,6 +3,7 @@ precision highp float;
3#endif 3#endif
4 4
5uniform float u_time; 5uniform float u_time;
6uniform float u_speed;
6uniform vec2 u_resolution; 7uniform vec2 u_resolution;
7uniform sampler2D u_tex0; 8uniform sampler2D u_tex0;
8 9
@@ -10,17 +11,19 @@ void main(void)
10{ 11{
11 vec2 uv; 12 vec2 uv;
12 13
14 float time = u_time * u_speed;
15
13 vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; 16 vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy;
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 float s = r * (1.0+0.8*cos(u_time*1.0)); 19 float s = r * (1.0+0.8*cos(time*1.0));
17 20
18 uv.x = .02*p.y+.03*cos(-u_time+a*3.0)/s; 21 uv.x = .02*p.y+.03*cos(-time+a*3.0)/s;
19 uv.y = .1*u_time +.02*p.x+.03*sin(-u_time+a*3.0)/s; 22 uv.y = .1*time +.02*p.x+.03*sin(-time+a*3.0)/s;
20 23
21 float w = .9 + pow(max(1.5-r,0.0),4.0); 24 float w = .9 + pow(max(1.5-r,0.0),4.0);
22 25
23 w*=0.6+0.4*cos(u_time+3.0*a); 26 w*=0.6+0.4*cos(time+3.0*a);
24 27
25 vec3 col = texture2D(u_tex0,uv).xyz; 28 vec3 col = texture2D(u_tex0,uv).xyz;
26 29