loadShader = function (gl, shaderSource, shaderType, optErrorCallback) {
  var errFn = optErrorCallback || error;
  // Create the shader object
  var shader = gl.createShader(shaderType);

  // Load the shader source
  gl.shaderSource(shader, shaderSource);

  // Compile the shader
  gl.compileShader(shader);

  // Check the compile status
  var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
  if (!compiled) {
    // Something went wrong during compilation; get the error
    var lastError = gl.getShaderInfoLog(shader);
    errFn("*** Error compiling shader '" + shader + "':" + lastError);
    gl.deleteShader(shader);
    return null;
  }

  return shader;
}
Loads a shader.
@param {!WebGLContext} gl The WebGLContext to use.
@param {string} shaderSource The shader source.
@param {number} shaderType The type of shader.
@param {function(string): void) optErrorCallback callback for errors.
@return {!WebGLShader} The created shader.