diff --git a/src/renderers/WebGLRenderTarget.js b/src/renderers/WebGLRenderTarget.js index aa5a9442f0c49449158f36027d052668e0760d50..50294b0aee01280488a30913e37ea9620dac7822 100644 --- a/src/renderers/WebGLRenderTarget.js +++ b/src/renderers/WebGLRenderTarget.js @@ -52,32 +52,39 @@ THREE.WebGLRenderTarget.prototype = { }, - clone: function () { + copy: function ( source ) { + + this.width = source.width; + this.height = source.height; + + this.wrapS = source.wrapS; + this.wrapT = source.wrapT; - var tmp = new THREE.WebGLRenderTarget( this.width, this.height ); + this.magFilter = source.magFilter; + this.minFilter = source.minFilter; - tmp.wrapS = this.wrapS; - tmp.wrapT = this.wrapT; + this.anisotropy = source.anisotropy; - tmp.magFilter = this.magFilter; - tmp.minFilter = this.minFilter; + this.offset.copy( source.offset ); + this.repeat.copy( source.repeat ); - tmp.anisotropy = this.anisotropy; + this.format = source.format; + this.type = source.type; - tmp.offset.copy( this.offset ); - tmp.repeat.copy( this.repeat ); + this.depthBuffer = source.depthBuffer; + this.stencilBuffer = source.stencilBuffer; - tmp.format = this.format; - tmp.type = this.type; + this.generateMipmaps = source.generateMipmaps; - tmp.depthBuffer = this.depthBuffer; - tmp.stencilBuffer = this.stencilBuffer; + this.shareDepthFrom = source.shareDepthFrom; - tmp.generateMipmaps = this.generateMipmaps; + return this; - tmp.shareDepthFrom = this.shareDepthFrom; + }, + + clone: function () { - return tmp; + return new THREE.WebGLRenderTarget().copy( this ); },