code: function (texture, attachment, target) {
  
          if (!texture.width) {
              throw new Error('The texture attached to color buffer is not a valid.');
          }
          // TODO width and height check
  
          // If the depth_texture extension is enabled, developers
          // Can attach a depth texture to the depth buffer
          // http://blog.tojicode.com/2012/07/using-webgldepthtexture.html
          attachment = attachment || GL_COLOR_ATTACHMENT0;
          target = target || glenum.TEXTURE_2D;
  
          var boundRenderer = this._boundRenderer;
          var _gl = boundRenderer && boundRenderer.gl;
          var attachedTextures;
  
          if (_gl) {
              var cache = this._cache;
              cache.use(boundRenderer.__uid__);
              attachedTextures = cache.get('attached_textures');
          }
  
          // Check if texture attached
          var previous = this._textures[attachment];
          if (previous && previous.target === target
              && previous.texture === texture
              && (attachedTextures && attachedTextures[attachment] != null)
          ) {
              return;
          }
  
          var canAttach = true;
          if (boundRenderer) {
              canAttach = this._doAttach(boundRenderer, texture, attachment, target);
              // Set viewport again incase attached to different size textures.
              if (!this.viewport) {
                  boundRenderer.setViewport(0, 0, texture.width, texture.height, 1);
              }
          }
  
          if (canAttach) {
              this._textures[attachment] = this._textures[attachment] || {};
              this._textures[attachment].texture = texture;
              this._textures[attachment].target = target;
          }
      }
docs: Attach a texture(RTT) to the framebuffer
  @param  {clay.Texture} texture
  @param  {number} [attachment=gl.COLOR_ATTACHMENT0]
  @param  {number} [target=gl.TEXTURE_2D]