color;

void main() {
  gl_Position = position;
  gl_PointSize = pointSize;
  v_color = color;
}
`;

const fs = `
precision mediump float;
varying vec4 v_color;
void main() {
  gl_FragColor = v_color;
}
`;

const prg = twgl.createProgram(gl, [vs, fs]);

const posLoc = gl.getAttribLocation(prg, 'position');
const sizeLoc = gl.getAttribLocation(prg, 'pointSize');
const colorLoc = gl.getAttribLocation(prg, 'color');

const numPoints = 12;
const points = [];
for (let i = 0; i < numPoints; ++i) {
  points.push({