From 447268000c379f619c78d7132c81e23b5c252598 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 17 Apr 2012 09:20:49 -0700 Subject: Cloud material --- assets/shaders/Cloud.frag.glsl | 4 ++-- assets/shaders/Cloud.vert.glsl | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'assets/shaders') 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; void main() { vec4 c = texture2D(u_tex0, v_texCoord0); - //c.a *= u_surfaceAlpha; - gl_FragColor = c; + c.a *= u_surfaceAlpha; + gl_FragColor = c; } \ 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; // matrix uniforms uniform mat4 u_mvMatrix; uniform mat4 u_projMatrix; -uniform mat4 u_worldMatrix; // varying varying vec2 v_texCoord0; // constants -const float zSpeed = 2.0; +const float zSpeed = 10.0; void main() { // Transform position vec4 pos = vec4(a_pos,1); + float dz = u_time*zSpeed; float n = floor( dz/(u_zmax-u_zmin) ); dz -= n*(u_zmax - u_zmin); @@ -44,6 +44,7 @@ void main() z = u_zmin + (z - u_zmax); } pos.z = z; + gl_Position = u_projMatrix * u_mvMatrix * pos; v_texCoord0 = texcoord; -- cgit v1.2.3