From b2ce8b819cc85a558d862c04965b7e65a6ce8640 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 1 Feb 2012 13:05:32 -0800 Subject: changes to allow minimal rendering ofnon-animated materials. --- assets/shaders/Taper.vert.glsl | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 assets/shaders/Taper.vert.glsl (limited to 'assets/shaders/Taper.vert.glsl') diff --git a/assets/shaders/Taper.vert.glsl b/assets/shaders/Taper.vert.glsl new file mode 100644 index 00000000..46f04fb3 --- /dev/null +++ b/assets/shaders/Taper.vert.glsl @@ -0,0 +1,61 @@ +/* +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 vert; +attribute vec3 normal; +attribute vec2 texcoord; + +// scalar uniforms +uniform float u_limit1; +uniform float u_limit2; +uniform float u_limit3; +uniform float u_taperAmount; + +uniform vec4 color; + + +// matrix uniforms +uniform mat4 u_mvMatrix; +uniform mat4 u_projMatrix; +uniform mat4 u_worldMatrix; + +varying vec4 v_color; + + +void main(void) +{ + vec3 pos = vert; + vec2 uv = texcoord; + + v_color = vec4(0, 1, 0, 1); + if (uv.x > u_limit1) + { + if (uv.x < u_limit2) + { + float t = (uv.x - u_limit1)/(u_limit2 - u_limit1); + pos.y = pos.y - t*u_taperAmount; + v_color = vec4( 1, 1, 0, 1 ); + } + else if (uv.x < u_limit3) + { + float t = 1.0 - (uv.x - u_limit2)/(u_limit3 - u_limit2); + pos.y = pos.y - t*u_taperAmount; + v_color = vec4( 0, 1, 1, 1 ); + } + else + v_color = vec4(0,0,1,1); + } + + + gl_Position = u_projMatrix * u_mvMatrix * vec4(pos,1.0) ; +} \ No newline at end of file -- cgit v1.2.3