aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Cloud.vert.glsl
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-06-19 10:25:16 -0700
committerJose Antonio Marquez2012-06-19 10:25:16 -0700
commit4d2a5acd1631f0cf4e38f127c886f481668ddce0 (patch)
tree3bc8f2b21826c0ee6d37bc77753d45a882783cbf /assets/shaders/Cloud.vert.glsl
parent616b31a644ee221edcbc19f821b2194e8edf9fad (diff)
parent483ad57efcd6475776f580c3af5b60e6deeaf781 (diff)
downloadninja-4d2a5acd1631f0cf4e38f127c886f481668ddce0.tar.gz
Merge branch 'refs/heads/Ninja-Internal' into FileIO
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