diff options
author | Valerio Virgillito | 2012-02-23 00:34:37 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-23 00:34:37 -0800 |
commit | 3675cac3993430490d9eef18157314d53ffa1a6a (patch) | |
tree | fb225a6d8fc3c983c96b1507483d628909dc8c1e /assets/shaders/Flag.vert.glsl | |
parent | 2afef244a3f8124f8a049e504e9782c05904ce23 (diff) | |
parent | 3730bbc7cc5d5f07b3d788885475a8f9810b480e (diff) | |
download | ninja-3675cac3993430490d9eef18157314d53ffa1a6a.tar.gz |
Merge pull request #60 from mqg734/WebGLMaterials
Integrating WebGL and canvas-2d drawing fixes. Fixed Materials Editor Popup to work with latest Montage framework. Also adding back WebGL materials.
Diffstat (limited to 'assets/shaders/Flag.vert.glsl')
-rw-r--r-- | assets/shaders/Flag.vert.glsl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/assets/shaders/Flag.vert.glsl b/assets/shaders/Flag.vert.glsl new file mode 100644 index 00000000..7dc932a7 --- /dev/null +++ b/assets/shaders/Flag.vert.glsl | |||
@@ -0,0 +1,35 @@ | |||
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 a_pos; | ||
15 | attribute vec2 texcoord; | ||
16 | |||
17 | // scalar uniforms | ||
18 | uniform float u_time; | ||
19 | |||
20 | // matrix uniforms | ||
21 | uniform mat4 u_mvMatrix; | ||
22 | uniform mat4 u_projMatrix; | ||
23 | uniform mat4 u_worldMatrix; | ||
24 | |||
25 | void main() | ||
26 | { | ||
27 | float angle = (u_time%360)*2; | ||
28 | |||
29 | a_pos.z = sin( a_pos.x + angle); | ||
30 | a_pos.z += sin( a_pos.y/2 + angle); | ||
31 | a_pos.z *= a_pos.x * 0.09; | ||
32 | gl_Position = u_projMatrix * u_mvMatrix * vec4(a_pos,1.0) ; | ||
33 | |||
34 | gl_FragColor = v_color; | ||
35 | } | ||