function Program(renderer) {
      var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
          parent = _ref4.parent,
          vertexShader = _ref4.vertexShader,
          fragmentShader = _ref4.fragmentShader;

      _classCallCheck(this, Program);

      this.type = "Program";

      if (!renderer || renderer.type !== "Renderer") {
        throwError(this.type + ": Renderer not passed as first argument", renderer);
      } else if (!renderer.gl) {
        throwError(this.type + ": Renderer WebGL context is undefined", renderer); // return if no gl context

        return;
      }

      this.renderer = renderer;
      this.gl = this.renderer.gl;
      this.parent = parent;
      this.defaultVsCode = this.parent.type === "Plane" ? planeVS$1 : shaderPassVS$1;
      this.defaultFsCode = this.parent.type === "Plane" ? planeFS$1 : shaderPassFS$1; // use the vertex shader specified or fallback to a default one

      if (!vertexShader) {
        if (!this.renderer.production && this.parent.type === "Plane") {
          throwWarning(this.parent.type + ": No vertex shader provided, will use a default one");
        }

        this.vsCode = this.defaultVsCode;
      } else {
        this.vsCode = vertexShader;
      } // use the fragment shader specified or fallback to a default one


      if (!fragmentShader) {
        if (!this.renderer.production) {
          throwWarning(this.parent.type + ": No fragment shader provided, will use a default one");
        }

        this.fsCode = this.defaultFsCode;
      } else {
        this.fsCode = fragmentShader;
      }

      this.compiled = true;
      this.setupProgram();
    }
Program class that creates, compiles and links the shaders
   Use a cache system to get already compiled shaders and save some CPU
   Also responsible for the creation, setting and updating of the uniforms (see Uniforms class object)
     params:
   @renderer (Renderer class object): our renderer class object
     @parent (Plane/ShaderPass class object): the mesh that will use that program
   @vertexShader (string): vertex shader as a string
   @fragmentShader (string): fragment shader as a string
     returns:
   @this: our newly created Program
*