diff options
Diffstat (limited to 'assets/shaders')
-rw-r--r-- | assets/shaders/Cloud.frag.glsl | 4 | ||||
-rw-r--r-- | assets/shaders/Cloud.vert.glsl | 5 |
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; | |||
18 | void main() | 18 | void 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 |
23 | uniform mat4 u_mvMatrix; | 23 | uniform mat4 u_mvMatrix; |
24 | uniform mat4 u_projMatrix; | 24 | uniform mat4 u_projMatrix; |
25 | uniform mat4 u_worldMatrix; | ||
26 | 25 | ||
27 | // varying | 26 | // varying |
28 | varying vec2 v_texCoord0; | 27 | varying vec2 v_texCoord0; |
29 | 28 | ||
30 | // constants | 29 | // constants |
31 | const float zSpeed = 2.0; | 30 | const float zSpeed = 10.0; |
32 | 31 | ||
33 | 32 | ||
34 | void main() | 33 | void 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; |