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/Cloud.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/Cloud.vert.glsl')
-rw-r--r-- | assets/shaders/Cloud.vert.glsl | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/assets/shaders/Cloud.vert.glsl b/assets/shaders/Cloud.vert.glsl index 95c14132..a33429fe 100644 --- a/assets/shaders/Cloud.vert.glsl +++ b/assets/shaders/Cloud.vert.glsl | |||
@@ -34,7 +34,7 @@ precision highp float; | |||
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | // attributes | 36 | // attributes |
37 | attribute vec3 a_pos; | 37 | attribute vec3 a_pos; |
38 | attribute vec2 texcoord; | 38 | attribute vec2 texcoord; |
39 | 39 | ||
40 | // uniforms | 40 | // uniforms |
@@ -48,7 +48,7 @@ uniform mat4 u_mvMatrix; | |||
48 | uniform mat4 u_projMatrix; | 48 | uniform mat4 u_projMatrix; |
49 | 49 | ||
50 | // varying | 50 | // varying |
51 | varying vec2 v_texCoord0; | 51 | varying vec2 v_texCoord0; |
52 | 52 | ||
53 | // constants | 53 | // constants |
54 | const float zSpeed = 10.0; | 54 | const float zSpeed = 10.0; |
@@ -57,19 +57,19 @@ const float zSpeed = 10.0; | |||
57 | void main() | 57 | void main() |
58 | { | 58 | { |
59 | // Transform position | 59 | // Transform position |
60 | vec4 pos = vec4(a_pos,1); | 60 | vec4 pos = vec4(a_pos,1); |
61 | 61 | ||
62 | float dz = u_time*zSpeed; | 62 | float dz = u_time*zSpeed; |
63 | float n = floor( dz/(u_zmax-u_zmin) ); | 63 | float n = floor( dz/(u_zmax-u_zmin) ); |
64 | dz -= n*(u_zmax - u_zmin); | 64 | dz -= n*(u_zmax - u_zmin); |
65 | float z = pos.z + dz; | 65 | float z = pos.z + dz; |
66 | if (z > u_zmax) | 66 | if (z > u_zmax) |
67 | { | 67 | { |
68 | z = u_zmin + (z - u_zmax); | 68 | z = u_zmin + (z - u_zmax); |
69 | } | 69 | } |
70 | pos.z = z; | 70 | pos.z = z; |
71 | |||
72 | gl_Position = u_projMatrix * u_mvMatrix * pos; | ||
71 | 73 | ||
72 | gl_Position = u_projMatrix * u_mvMatrix * pos; | ||
73 | |||
74 | v_texCoord0 = texcoord; | 74 | v_texCoord0 = texcoord; |
75 | } | 75 | } |