aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Star.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/Star.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/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