I don't have it available at the moment it's on another machine but of the top of my head it should be something like:
vertex shader:
attribute vec3 aPosition
attribute float aPointSize
uniform mat4 uViewMatrix
uniform mat4 uProjection
varying float vPointSize
varying vec2 vPosition
void main(){
vec4 position=uProjection * uViewMatrix * vec4(aPosition,1.0);
gl_PointSize=aPointSize;
gl_Position=position;
//send the point size though to the fragment shader
vPointSize=aPointSize;
//send the screen coord though to the fragment shader
vPosition=vec2(position.x/position.w,position.y/position.w);
}
fragment shader:
varying float vPointSize
varying vec2 vPosition
uniform vec2 uCanvasDims
void main(){
//get screen coord from frag coord
float screenX=(gl_FragCoord.x/uCanvasDims.x-0.5)*2;
float screenY=(gl_FragCoord.y/uCanvasDims.y-0.5)*2;
//find the difference between the fragments screen position and the points screen position then simply work out the point coord from the point size
vec2 pointCoord=vec2( (screenX-vPosition.x)/(vPointSize/uCanvasDims.x), (screenY-vPosition.y)/(vPointSize/uCanvasDims.x));
}
I've not tested so there maybe errors but hopefully you get the giest and it points you in a workable direction.