Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed Vertex Shader for the simple animation demo

  • Loading branch information...
1 parent 88a0d0b commit 2336fc17d9e7761ca8b96da62ad2f8bb0756b496 Michelangelo De Simone committed
13 samples/css-customfilters/simple-vertex-animation/shaders/flag.vs
@@ -6,28 +6,25 @@ Permissions beyond the scope of this license, pertaining to the examples of code
precision mediump float;
-attribute vec3 a_position;
+attribute vec4 a_position;
attribute vec2 a_texCoord;
uniform mat4 u_projectionMatrix;
-// This uniform value is passed in using CSS.
+// These uniform values are passed in using CSS.
uniform mat4 txf;
+uniform float phase;
+uniform float amplitude;
varying vec2 v_texCoord;
const float PI = 3.1415;
-// Shader uniforms to be passed by CSS
-uniform float phase;
-uniform float amplitude;
const float degToRad = PI / 180.0;
void main()
v_texCoord = a_texCoord;
- vec4 pos = vec4(a_position, 1.0);
+ vec4 pos = a_position;
float phi = degToRad * phase;
pos.z = amplitude * cos(pos.x * PI * 2.0 + phi);

0 comments on commit 2336fc1

Please sign in to comment.
Something went wrong with that request. Please try again.