diff options
author | hwc487 | 2012-04-15 05:16:34 -0700 |
---|---|---|
committer | hwc487 | 2012-04-15 05:16:34 -0700 |
commit | 8992d9baf542135e910bb59328a592d9e330703a (patch) | |
tree | 268465b69fd37ec1dc33d304de959e79dc619ecd /assets | |
parent | 331b2ad4d602016f9bb3d03be759fd81fed50c10 (diff) | |
download | ninja-8992d9baf542135e910bb59328a592d9e330703a.tar.gz |
Cloud Material
Diffstat (limited to 'assets')
-rwxr-xr-x | assets/shaders/Basic.vert.glsl | 3 | ||||
-rw-r--r-- | assets/shaders/BasicTex.frag.glsl | 19 | ||||
-rw-r--r-- | assets/shaders/Cloud.frag.glsl | 4 |
3 files changed, 24 insertions, 2 deletions
diff --git a/assets/shaders/Basic.vert.glsl b/assets/shaders/Basic.vert.glsl index 0d5b8d63..f96f8322 100755 --- a/assets/shaders/Basic.vert.glsl +++ b/assets/shaders/Basic.vert.glsl | |||
@@ -14,6 +14,8 @@ precision highp float; | |||
14 | attribute vec3 a_pos; | 14 | attribute vec3 a_pos; |
15 | attribute vec2 texcoord; | 15 | attribute vec2 texcoord; |
16 | 16 | ||
17 | // varying | ||
18 | varying vec2 v_texCoord0; | ||
17 | 19 | ||
18 | // matrix uniforms | 20 | // matrix uniforms |
19 | uniform mat4 u_mvMatrix; | 21 | uniform mat4 u_mvMatrix; |
@@ -22,5 +24,6 @@ uniform mat4 u_worldMatrix; | |||
22 | 24 | ||
23 | void main(void) | 25 | void main(void) |
24 | { | 26 | { |
27 | v_texCoord0 = texcoord; | ||
25 | gl_Position = u_projMatrix * u_mvMatrix * vec4(a_pos,1.0) ; | 28 | gl_Position = u_projMatrix * u_mvMatrix * vec4(a_pos,1.0) ; |
26 | } \ No newline at end of file | 29 | } \ No newline at end of file |
diff --git a/assets/shaders/BasicTex.frag.glsl b/assets/shaders/BasicTex.frag.glsl new file mode 100644 index 00000000..a716e77d --- /dev/null +++ b/assets/shaders/BasicTex.frag.glsl | |||
@@ -0,0 +1,19 @@ | |||
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 | |||
14 | varying vec2 v_texCoord0; | ||
15 | |||
16 | |||
17 | void main() { | ||
18 | gl_FragColor = texture2D(u_tex0, v_texCoord0); | ||
19 | } | ||
diff --git a/assets/shaders/Cloud.frag.glsl b/assets/shaders/Cloud.frag.glsl index b07bb627..ba1ef39e 100644 --- a/assets/shaders/Cloud.frag.glsl +++ b/assets/shaders/Cloud.frag.glsl | |||
@@ -17,7 +17,7 @@ varying vec2 v_texCoord0; | |||
17 | 17 | ||
18 | void main() | 18 | void main() |
19 | { | 19 | { |
20 | // gl_FragColor = texture2D(u_tex0, v_texCoord0) * u_surfaceAlpha; | 20 | gl_FragColor = texture2D(u_tex0, v_texCoord0) * u_surfaceAlpha; |
21 | gl_FragColor = vec4(1,0,0,1); | 21 | //gl_FragColor = texture2D(u_tex0, v_texCoord0); |
22 | } | 22 | } |
23 | \ No newline at end of file | 23 | \ No newline at end of file |