aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders
diff options
context:
space:
mode:
authorhwc4872012-04-17 09:20:49 -0700
committerhwc4872012-04-17 09:20:49 -0700
commit447268000c379f619c78d7132c81e23b5c252598 (patch)
tree5858e057216c6fe50fc5cc3289f7c9d5f6a248a1 /assets/shaders
parentc0aa5e88890fbf74124d019df96c33215da99f17 (diff)
downloadninja-447268000c379f619c78d7132c81e23b5c252598.tar.gz
Cloud material
Diffstat (limited to 'assets/shaders')
-rw-r--r--assets/shaders/Cloud.frag.glsl4
-rw-r--r--assets/shaders/Cloud.vert.glsl5
2 files changed, 5 insertions, 4 deletions
diff --git a/assets/shaders/Cloud.frag.glsl b/assets/shaders/Cloud.frag.glsl
index c21dcf97..3d466a24 100644
--- a/assets/shaders/Cloud.frag.glsl
+++ b/assets/shaders/Cloud.frag.glsl
@@ -18,7 +18,7 @@ varying vec2 v_texCoord0;
18void main() 18void main()
19{ 19{
20 vec4 c = texture2D(u_tex0, v_texCoord0); 20 vec4 c = texture2D(u_tex0, v_texCoord0);
21 //c.a *= u_surfaceAlpha; 21 c.a *= u_surfaceAlpha;
22 gl_FragColor = c; 22 gl_FragColor = c;
23} 23}
24 \ No newline at end of file 24 \ No newline at end of file
diff --git a/assets/shaders/Cloud.vert.glsl b/assets/shaders/Cloud.vert.glsl
index c8ca9f3f..acd581fc 100644
--- a/assets/shaders/Cloud.vert.glsl
+++ b/assets/shaders/Cloud.vert.glsl
@@ -22,19 +22,19 @@ uniform float u_surfaceAlpha;
22// matrix uniforms 22// matrix uniforms
23uniform mat4 u_mvMatrix; 23uniform mat4 u_mvMatrix;
24uniform mat4 u_projMatrix; 24uniform mat4 u_projMatrix;
25uniform mat4 u_worldMatrix;
26 25
27// varying 26// varying
28varying vec2 v_texCoord0; 27varying vec2 v_texCoord0;
29 28
30// constants 29// constants
31const float zSpeed = 2.0; 30const float zSpeed = 10.0;
32 31
33 32
34void main() 33void main()
35{ 34{
36 // Transform position 35 // Transform position
37 vec4 pos = vec4(a_pos,1); 36 vec4 pos = vec4(a_pos,1);
37
38 float dz = u_time*zSpeed; 38 float dz = u_time*zSpeed;
39 float n = floor( dz/(u_zmax-u_zmin) ); 39 float n = floor( dz/(u_zmax-u_zmin) );
40 dz -= n*(u_zmax - u_zmin); 40 dz -= n*(u_zmax - u_zmin);
@@ -44,6 +44,7 @@ void main()
44 z = u_zmin + (z - u_zmax); 44 z = u_zmin + (z - u_zmax);
45 } 45 }
46 pos.z = z; 46 pos.z = z;
47
47 gl_Position = u_projMatrix * u_mvMatrix * pos; 48 gl_Position = u_projMatrix * u_mvMatrix * pos;
48 49
49 v_texCoord0 = texcoord; 50 v_texCoord0 = texcoord;