aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Cloud.vert.glsl
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-20 15:00:19 -0700
committerArmen Kesablyan2012-06-20 15:00:19 -0700
commit120e31dcf1e11eed11ee430d77c438e7b073e9f8 (patch)
tree8c07b1203de42f6efdeebfc8663072fffb4a567b /assets/shaders/Cloud.vert.glsl
parentc59eb371559a3061ce53223e249ca97daace5968 (diff)
parent52833c3d8a485944c42acc6ac0ae5139b3427da8 (diff)
downloadninja-120e31dcf1e11eed11ee430d77c438e7b073e9f8.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Diffstat (limited to 'assets/shaders/Cloud.vert.glsl')
-rw-r--r--assets/shaders/Cloud.vert.glsl51
1 files changed, 51 insertions, 0 deletions
diff --git a/assets/shaders/Cloud.vert.glsl b/assets/shaders/Cloud.vert.glsl
new file mode 100644
index 00000000..acd581fc
--- /dev/null
+++ b/assets/shaders/Cloud.vert.glsl
@@ -0,0 +1,51 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7
8#ifdef GL_ES
9precision highp float;
10#endif
11
12// attributes
13attribute vec3 a_pos;
14attribute vec2 texcoord;
15
16// uniforms
17uniform float u_time;
18uniform float u_zmin;
19uniform float u_zmax;
20uniform float u_surfaceAlpha;
21
22// matrix uniforms
23uniform mat4 u_mvMatrix;
24uniform mat4 u_projMatrix;
25
26// varying
27varying vec2 v_texCoord0;
28
29// constants
30const float zSpeed = 10.0;
31
32
33void main()
34{
35 // Transform position
36 vec4 pos = vec4(a_pos,1);
37
38 float dz = u_time*zSpeed;
39 float n = floor( dz/(u_zmax-u_zmin) );
40 dz -= n*(u_zmax - u_zmin);
41 float z = pos.z + dz;
42 if (z > u_zmax)
43 {
44 z = u_zmin + (z - u_zmax);
45 }
46 pos.z = z;
47
48 gl_Position = u_projMatrix * u_mvMatrix * pos;
49
50 v_texCoord0 = texcoord;
51} \ No newline at end of file