3 layout(location=0) in vec2 aPosition;
4 layout(location=0) out vec2 vTexCoord;
6 layout(set = 0, binding = 0, std140) uniform VertData
15 //Visual size and offset
25 vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
26 vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
28 vec2 size = visualSize.xy;
30 vec2 fixedFactor = vec2( uFixed[ int( ( aPosition.x + 1.0 ) * 0.5 ) ].x, uFixed[ int( ( aPosition.y + 1.0 ) * 0.5 ) ].y );
31 vec2 stretch = floor( aPosition * 0.5 );
32 vec2 fixedTotal = uFixed[ 2 ];
34 vec4 vertexPosition = vec4( fixedFactor + ( size - fixedTotal ) * stretch, 0.0, 1.0 );
35 vertexPosition.xy -= size * vec2( 0.5, 0.5 );
36 vertexPosition.xy = vertexPosition.xy + anchorPoint*size + (visualOffset + origin)*uSize.xy;\
38 vertexPosition = uMvpMatrix * vertexPosition;
40 vTexCoord = ( fixedFactor + stretch * uStretchTotal ) / ( fixedTotal + uStretchTotal );
42 gl_Position = vertexPosition;