#version 300 es precision highp float; in vec3 point_color; in float point_highlight; in float total_radius; out vec4 outColor; void main() { float r = total_radius * length(2.*gl_PointCoord - vec2(1.)); const float POINT_RADIUS = 4.; float border = smoothstep(POINT_RADIUS - 1., POINT_RADIUS, r); vec3 color = mix(point_color, vec3(1.), border * point_highlight); outColor = vec4(color, 1. - smoothstep(total_radius - 1., total_radius, r)); }