l");
  }
  catch(e) {
  }
  if (!gl) {
    throw "Failed to initialize WebGL.";
  }

  // vertex shader
  var vertexShader = gl.createShader(gl.VERTEX_SHADER);
  gl.shaderSource(vertexShader, vertexShaderSource);
  gl.compileShader(vertexShader);
  if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
    throw "Failed to compile vertex shader.\n" + gl.getShaderInfoLog(vertexShader);
  }

  // fragment shader
  var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
  gl.shaderSource(fragmentShad