diff options
author | hwc487 | 2012-04-10 10:12:49 -0700 |
---|---|---|
committer | hwc487 | 2012-04-10 10:12:49 -0700 |
commit | c1a6cacf364d79cbf23b41e7089a1a6d39afea85 (patch) | |
tree | c900a4f6063da1be1c7febb66ce8021def739ea1 /assets | |
parent | 5b878fdfaa696c1a01afa191c1d65c0ccb006b65 (diff) | |
download | ninja-c1a6cacf364d79cbf23b41e7089a1a6d39afea85.tar.gz |
Cloud material
Diffstat (limited to 'assets')
-rw-r--r-- | assets/shaders/Cloud.frag.glsl | 23 | ||||
-rw-r--r-- | assets/shaders/Cloud.vert.glsl | 42 |
2 files changed, 65 insertions, 0 deletions
diff --git a/assets/shaders/Cloud.frag.glsl b/assets/shaders/Cloud.frag.glsl new file mode 100644 index 00000000..522e17bb --- /dev/null +++ b/assets/shaders/Cloud.frag.glsl | |||
@@ -0,0 +1,23 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | ||
9 | precision highp float; | ||
10 | #endif | ||
11 | |||
12 | uniform sampler2D u_tex0; | ||
13 | uniform float u_surfaceAlpha; | ||
14 | |||
15 | varying vec4 v_Colors; | ||
16 | varying vec2 v_texCoord0; | ||
17 | |||
18 | |||
19 | void main() | ||
20 | { | ||
21 | gl_FragColor = texture2D(u_tex0, v_texCoord0) * u_surfaceAlpha; | ||
22 | } | ||
23 | \ No newline at end of file | ||
diff --git a/assets/shaders/Cloud.vert.glsl b/assets/shaders/Cloud.vert.glsl new file mode 100644 index 00000000..fbd7f40b --- /dev/null +++ b/assets/shaders/Cloud.vert.glsl | |||
@@ -0,0 +1,42 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | ||
9 | precision highp float; | ||
10 | #endif | ||
11 | |||
12 | // attributes | ||
13 | attribute vec3 a_pos; | ||
14 | attribute vec2 texcoord; | ||
15 | |||
16 | // uniforms | ||
17 | uniform float u_time; | ||
18 | uniform float u_zmin; | ||
19 | uniform float u_zmax; | ||
20 | uniform float u_surfaceAlpha; | ||
21 | |||
22 | // matrix uniforms | ||
23 | uniform mat4 u_mvMatrix; | ||
24 | uniform mat4 u_projMatrix; | ||
25 | uniform mat4 u_worldMatrix; | ||
26 | |||
27 | // varying | ||
28 | varying vec2 v_texCoord0; | ||
29 | |||
30 | // constants | ||
31 | const float zSpeed = 1.0; | ||
32 | |||
33 | |||
34 | void main() | ||
35 | { | ||
36 | // Transform position | ||
37 | vec4 pos = a_pos; | ||
38 | pos.z += u+time*zSpeed; | ||
39 | gl_Position = u_projMatrix * u_mvMatrix * pos; | ||
40 | |||
41 | v_texCoord0 = texcoord; | ||
42 | } \ No newline at end of file | ||