uniform mediump vec2 origin;\n
uniform mediump vec2 anchorPoint;\n
- vec4 ComputeVertexPosition()\n
+ vec2 ComputeVertexPosition()\n
{\n
vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
- return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
+ return (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy;\n
}\n
void main()\n
{\n
- vec2 position = ComputeVertexPosition().xy + aDrift*borderSize;\n
+ vec2 position = ComputeVertexPosition() + aDrift*borderSize;\n
gl_Position = uMvpMatrix * vec4(position, 0.0, 1.0);\n
}\n
);
mediump vec2 stretch = floor( aPosition * 0.5 );\n
mediump vec2 fixedTotal = uFixed[ 2 ];\n
\n
- mediump vec4 vertexPosition = vec4( fixedFactor + ( size - fixedTotal ) * stretch + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
- vertexPosition.xy -= visualSize * vec2( 0.5, 0.5 );\n
- vertexPosition.xy = vertexPosition.xy / scale;\n
+ mediump vec4 vertexPosition = vec4( fixedFactor + ( size - fixedTotal ) * stretch, 0.0, 1.0 );
+ vertexPosition.xy -= size * vec2( 0.5, 0.5 );\n
+ vertexPosition.xy = vertexPosition.xy / scale + anchorPoint*size + (visualOffset + origin)*uSize.xy;\
\n
vertexPosition = uMvpMatrix * vertexPosition;\n
\n