#version 130

varying float size;
varying vec3 color;

void main (void)
{
  float dist;
  
  if (size > 1.0) 
    dist = 1.0 - clamp( pow(length( (gl_PointCoord.xy - vec2(.5,.5)))*2.0, 4.0), 0.0, 1.0);
  else 
    dist = 1.0;
  
  gl_FragColor = vec4( color, (1.0 - pow(size/100.0,.1)) * dist );
}