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/plasma.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/plasma.frag.glsl')
-rw-r--r-- | assets/shaders/plasma.frag.glsl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/assets/shaders/plasma.frag.glsl b/assets/shaders/plasma.frag.glsl index 248288a6..4a5ac3da 100644 --- a/assets/shaders/plasma.frag.glsl +++ b/assets/shaders/plasma.frag.glsl | |||
@@ -16,15 +16,21 @@ precision highp float; | |||
16 | 16 | ||
17 | varying vec2 v_uv; | 17 | varying vec2 v_uv; |
18 | uniform float u_time; | 18 | uniform float u_time; |
19 | uniform vec4 color; | 19 | |
20 | uniform float u_wave; | ||
21 | uniform float u_wave1; | ||
22 | uniform float u_wave2; | ||
23 | uniform float u_speed; | ||
20 | 24 | ||
21 | void main(void) | 25 | void main(void) |
22 | { | 26 | { |
23 | float x = v_uv.x ; | 27 | float x = v_uv.x ; |
24 | float y = v_uv.y ; | 28 | float y = v_uv.y ; |
25 | float time = u_time; | 29 | float time = u_time*u_speed; |
26 | float wave = (cos(time + y / 0.2 + cos(x / 0.3 + cos((y / 0.1))))); | 30 | |
27 | float wave1 = (sin(abs(wave + y/0.6))); | 31 | float wave = (cos(time + y / (u_wave+0.2) + cos(x / (u_wave+0.3) + cos((y / (u_wave+0.1)))))); |
28 | float wave2 = (sin(abs(wave1 + y/0.8))); | 32 | float wave1 = (sin(abs(wave + y/u_wave1))); |
33 | float wave2 = (sin(abs(wave1 + y/u_wave2))); | ||
34 | |||
29 | gl_FragColor = vec4( abs(vec3(wave2,wave1,wave)),1.0); | 35 | gl_FragColor = vec4( abs(vec3(wave2,wave1,wave)),1.0); |
30 | } | 36 | } |