1 attribute mediump vec2 aPosition;
2 uniform highp mat4 uMvpMatrix;
3 uniform highp vec3 uSize;
4 uniform mediump mat3 uAlignmentMatrix;
5 varying mediump vec2 vTexCoord;
7 //Visual size and offset
8 uniform mediump vec2 offset;
9 uniform highp vec2 size;
10 uniform mediump vec4 offsetSizeMode;
11 uniform mediump vec2 origin;
12 uniform mediump vec2 anchorPoint;
14 vec4 ComputeVertexPosition()
16 vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
17 vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
18 return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
23 mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);
24 vTexCoord = (uAlignmentMatrix*vertexPosition.xyw).xy;
26 gl_Position = uMvpMatrix * ComputeVertexPosition();