attribute vec2 a_position;
attribute vec2 a_uvPosition;
attribute float a_rotation;
attribute float a_size;
attribute float a_alpha;
attribute vec3 a_color;

uniform float u_frameSize_x;
uniform float u_frameSize_y;
uniform float u_targetWidth;

varying float rotation;
varying vec2 uvPosition;
varying float v_alpha;
varying vec3 v_color;

void main()
{
    rotation = a_rotation;
    uvPosition =  a_uvPosition;
    v_alpha = a_alpha;
    v_color = a_color;
    
    gl_Position = CC_MVPMatrix * vec4(a_position.x, a_position.y, 0.0, 1.0);
    vec4 scaledOrigin = (CC_MVPMatrix * vec4(0.0, 0.0, 0.0,1.0));
    vec4 scaledPointSize = (CC_MVPMatrix * vec4(a_size, a_size, 0.0,1.0));
    gl_PointSize =  abs(scaledOrigin.x - scaledPointSize.x) * 0.5 * u_targetWidth;
}
