diff options
author | hwc487 | 2012-02-01 13:05:32 -0800 |
---|---|---|
committer | hwc487 | 2012-02-01 13:05:32 -0800 |
commit | b2ce8b819cc85a558d862c04965b7e65a6ce8640 (patch) | |
tree | 520fb12c07ba78f93d22f693369db45248c448d1 /assets/shaders/Taper.vert.glsl | |
parent | aa1b4b78d9e1b9cc15529dbf7196b7ac8a88e260 (diff) | |
download | ninja-b2ce8b819cc85a558d862c04965b7e65a6ce8640.tar.gz |
changes to allow minimal rendering ofnon-animated materials.
Diffstat (limited to 'assets/shaders/Taper.vert.glsl')
-rw-r--r-- | assets/shaders/Taper.vert.glsl | 61 |
1 files changed, 61 insertions, 0 deletions
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 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | |||
8 | #ifdef GL_ES | ||
9 | precision highp float; | ||
10 | #endif | ||
11 | |||
12 | |||
13 | // attributes | ||
14 | attribute vec3 vert; | ||
15 | attribute vec3 normal; | ||
16 | attribute vec2 texcoord; | ||
17 | |||
18 | // scalar uniforms | ||
19 | uniform float u_limit1; | ||
20 | uniform float u_limit2; | ||
21 | uniform float u_limit3; | ||
22 | uniform float u_taperAmount; | ||
23 | |||
24 | uniform vec4 color; | ||
25 | |||
26 | |||
27 | // matrix uniforms | ||
28 | uniform mat4 u_mvMatrix; | ||
29 | uniform mat4 u_projMatrix; | ||
30 | uniform mat4 u_worldMatrix; | ||
31 | |||
32 | varying vec4 v_color; | ||
33 | |||
34 | |||
35 | void main(void) | ||
36 | { | ||
37 | vec3 pos = vert; | ||
38 | vec2 uv = texcoord; | ||
39 | |||
40 | v_color = vec4(0, 1, 0, 1); | ||
41 | if (uv.x > u_limit1) | ||
42 | { | ||
43 | if (uv.x < u_limit2) | ||
44 | { | ||
45 | float t = (uv.x - u_limit1)/(u_limit2 - u_limit1); | ||
46 | pos.y = pos.y - t*u_taperAmount; | ||
47 | v_color = vec4( 1, 1, 0, 1 ); | ||
48 | } | ||
49 | else if (uv.x < u_limit3) | ||
50 | { | ||
51 | float t = 1.0 - (uv.x - u_limit2)/(u_limit3 - u_limit2); | ||
52 | pos.y = pos.y - t*u_taperAmount; | ||
53 | v_color = vec4( 0, 1, 1, 1 ); | ||
54 | } | ||
55 | else | ||
56 | v_color = vec4(0,0,1,1); | ||
57 | } | ||
58 | |||
59 | |||
60 | gl_Position = u_projMatrix * u_mvMatrix * vec4(pos,1.0) ; | ||
61 | } \ No newline at end of file | ||