 // Copyright (c) 2014, Nicolas P. Rougier. All Rights Reserved.
 // Distributed under the (new) BSD License.
 // ----------------------------------------------------------------------------
+#include "math/constants.glsl"
 
-// Constants
-// ------------------------------------
-const float SQRT_2 = 1.4142135623730951;
 
 // Uniforms
-// ------------------------------------
-uniform mat4 u_model;
-uniform mat4 u_view;
-uniform mat4 u_projection;
+// --------
+uniform float antialias;
 
-// Externs
-// ------------------------------------
-// extern vec2  P0;
-// extern vec2  P1;
-// extern float index;
-// extern vec4  fg_color;
-// extern float antialias;
-// extern float linewidth;
+// Attributes
+// ----------
+attribute vec2  position;
+attribute float size;
+attribute vec4  fg_color;
+attribute vec4  bg_color;
+attribute float linewidth;
+attribute float orientation;
 
 // Varyings
-// ------------------------------------
+// --------
 varying float v_antialias;
 varying float v_linewidth;
 varying float v_size;

    v_bg_color    = bg_color;
    v_orientation = vec2(cos(orientation), sin(orientation));

    gl_Position = vec4(position, 1.0);
    gl_PointSize = SQRT_2 * size + 2.0 * (linewidth + 1.5*antialias);
}

varying vec4  v_bg_color;
varying vec2  v_orientation;

void main (void)
{
    v_size        = size;
    v_linewidth   = linewidth;
    v_antialias   = antialias;
