From c1a6cacf364d79cbf23b41e7089a1a6d39afea85 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 10 Apr 2012 10:12:49 -0700 Subject: Cloud material --- assets/shaders/Cloud.frag.glsl | 23 +++++++++++++++++++++++ assets/shaders/Cloud.vert.glsl | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 assets/shaders/Cloud.frag.glsl create mode 100644 assets/shaders/Cloud.vert.glsl (limited to 'assets/shaders') 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 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + + +#ifdef GL_ES +precision highp float; +#endif + +uniform sampler2D u_tex0; +uniform float u_surfaceAlpha; + +varying vec4 v_Colors; +varying vec2 v_texCoord0; + + +void main() +{ + gl_FragColor = texture2D(u_tex0, v_texCoord0) * u_surfaceAlpha; +} + \ 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 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + + +#ifdef GL_ES +precision highp float; +#endif + +// attributes +attribute vec3 a_pos; +attribute vec2 texcoord; + +// uniforms +uniform float u_time; +uniform float u_zmin; +uniform float u_zmax; +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 = 1.0; + + +void main() +{ + // Transform position + vec4 pos = a_pos; + pos.z += u+time*zSpeed; + gl_Position = u_projMatrix * u_mvMatrix * pos; + + v_texCoord0 = texcoord; +} \ No newline at end of file -- cgit v1.2.3