diff options
author | hwc487 | 2012-07-09 16:08:02 -0700 |
---|---|---|
committer | hwc487 | 2012-07-09 16:08:02 -0700 |
commit | 5085d0f67df89a21715308956004164597a6ba79 (patch) | |
tree | 2c896163143a66331205a39b0a3b1b45d51bf12a /assets/shaders/Flag.vert.glsl | |
parent | 51f1691f792dbda9b740ded8aa0457c9406db156 (diff) | |
parent | 84b3327bd92faafab7954b5eb64c7abe24a3fe13 (diff) | |
download | ninja-5085d0f67df89a21715308956004164597a6ba79.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into GridFixes
Conflicts:
js/helper-classes/3D/StageLine.js
Diffstat (limited to 'assets/shaders/Flag.vert.glsl')
-rw-r--r-- | assets/shaders/Flag.vert.glsl | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/assets/shaders/Flag.vert.glsl b/assets/shaders/Flag.vert.glsl index fe3ff722..6e2854ee 100644 --- a/assets/shaders/Flag.vert.glsl +++ b/assets/shaders/Flag.vert.glsl | |||
@@ -55,21 +55,22 @@ varying vec2 v_uv; | |||
55 | 55 | ||
56 | void main() | 56 | void main() |
57 | { | 57 | { |
58 | float time = u_time * u_speed; | 58 | float time = u_time * u_speed; |
59 | const float pi = 3.14159; | 59 | const float pi = 3.14159; |
60 | float angle = time; | 60 | float angle = time; |
61 | 61 | ||
62 | v_uv = texcoord; | 62 | v_uv.x = texcoord.x; |
63 | v_uv.y = texcoord.y; | ||
63 | 64 | ||
64 | float x = 2.0*pi*texcoord.x/u_waveWidth; | 65 | float x = 2.0*pi*texcoord.x/u_waveWidth; |
65 | float y = 2.0*pi*texcoord.y; | 66 | float y = 2.0*pi*texcoord.y; |
66 | 67 | ||
67 | vec3 v = a_pos; | 68 | vec3 v = a_pos; |
68 | v.z = sin( x + angle ); | 69 | v.z = sin( x + angle ); |
69 | v.z += sin( 0.2*y + angle); | 70 | v.z += sin( 0.2*y + angle); |
70 | v.z *= u_waveHeight; | 71 | v.z *= u_waveHeight; |
71 | v.z -= 2.0*u_waveHeight; | 72 | v.z -= 2.0*u_waveHeight; |
72 | v.z *= x * 0.09; | 73 | v.z *= x * 0.09; |
73 | 74 | ||
74 | gl_Position = u_projMatrix * u_mvMatrix * vec4(v,1.0) ; | 75 | gl_Position = u_projMatrix * u_mvMatrix * vec4(v,1.0) ; |
75 | } | 76 | } |