1 attribute mediump vec2 aPosition;
3 uniform mediump mat4 uMvpMatrix;
5 uniform vec4 uTextureRect;
7 uniform float uPercentage;
8 uniform vec3 uSaddleParam;
9 uniform vec2 uTranslation;
10 uniform vec2 uRotation;
11 uniform float uToNext;
13 varying float vPercentage;
14 varying vec2 vTexCoord;
18 mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);
19 vertexPosition.xyz *= uSize;
20 vertexPosition = uMvpMatrix * vertexPosition;
21 gl_Position = vertexPosition;
23 vec2 texCoord = aPosition + vec2(0.5);
26 //Calculate the distortion value given the dissolve central line
27 vec2 value = texCoord + uTranslation;
28 mat2 rotateMatrix = mat2(uRotation.s, uRotation.t, -uRotation.t, uRotation.s);
29 value = rotateMatrix * value;
31 value.s = uSaddleParam[2] + value.s;
32 float delay = value.t * value.t / uSaddleParam[0] - value.s * value.s / uSaddleParam[1];
33 vPercentage = clamp(uPercentage * 2.0 - 0.5 * sin(delay * 1.571) - 0.5, 0.0, 1.0);