diff options
author | Armen Kesablyan | 2012-06-20 15:00:19 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-20 15:00:19 -0700 |
commit | 120e31dcf1e11eed11ee430d77c438e7b073e9f8 (patch) | |
tree | 8c07b1203de42f6efdeebfc8663072fffb4a567b /assets/shaders/Star.frag.glsl | |
parent | c59eb371559a3061ce53223e249ca97daace5968 (diff) | |
parent | 52833c3d8a485944c42acc6ac0ae5139b3427da8 (diff) | |
download | ninja-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.glsl | 11 |
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 | ||
5 | uniform float u_time; | 5 | uniform float u_time; |
6 | uniform float u_speed; | ||
6 | uniform vec2 u_resolution; | 7 | uniform vec2 u_resolution; |
7 | uniform sampler2D u_tex0; | 8 | uniform 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 | ||