resize() {
        if(this.sourceType === "fbo") {
            // update size based on parent sizes (RenderTarget or ShaderPass)
            this._size = {
                width: this._parent._size && this._parent._size.width || this._parent._boundingRect.document.width,
                height: this._parent._size && this._parent._size.height || this._parent._boundingRect.document.height,
            };

            // reupload only if its not a texture set from another texture (means its a RenderTarget texture)
            if(!this._copiedFrom) {
                this.gl.bindTexture(this.gl.TEXTURE_2D, this._sampler.texture);
                this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this._globalParameters.internalFormat, this._size.width, this._size.height, 0, this._globalParameters.format, this._globalParameters.type, null);
            }
        }
        else if(this.source) {
            // reset texture sizes (useful for canvas because their dimensions might change on resize)
            this._size = {
                width: this.source.naturalWidth || this.source.width || this.source.videoWidth,
                height: this.source.naturalHeight || this.source.height || this.source.videoHeight,
            };
        }

        this._setSize();
    }
This is used to crop/center a texture
     If the texture is using texture matrix then we just have to update its matrix
     If it is a render pass texture we also upload the texture with its new size on the GPU
*