aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Cloud.vert.glsl
diff options
context:
space:
mode:
authorhwc4872012-07-09 16:08:02 -0700
committerhwc4872012-07-09 16:08:02 -0700
commit5085d0f67df89a21715308956004164597a6ba79 (patch)
tree2c896163143a66331205a39b0a3b1b45d51bf12a /assets/shaders/Cloud.vert.glsl
parent51f1691f792dbda9b740ded8aa0457c9406db156 (diff)
parent84b3327bd92faafab7954b5eb64c7abe24a3fe13 (diff)
downloadninja-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.glsl28
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
37attribute vec3 a_pos; 37attribute vec3 a_pos;
38attribute vec2 texcoord; 38attribute vec2 texcoord;
39 39
40// uniforms 40// uniforms
@@ -48,7 +48,7 @@ uniform mat4 u_mvMatrix;
48uniform mat4 u_projMatrix; 48uniform mat4 u_projMatrix;
49 49
50// varying 50// varying
51varying vec2 v_texCoord0; 51varying vec2 v_texCoord0;
52 52
53// constants 53// constants
54const float zSpeed = 10.0; 54const float zSpeed = 10.0;
@@ -57,19 +57,19 @@ const float zSpeed = 10.0;
57void main() 57void 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}