diff --git a/src/renderers/WebGLRenderTarget.js b/src/renderers/WebGLRenderTarget.js index 39b31632684316..62552e07905ed8 100644 --- a/src/renderers/WebGLRenderTarget.js +++ b/src/renderers/WebGLRenderTarget.js @@ -34,6 +34,7 @@ class WebGLRenderTarget extends EventDispatcher { this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false; + this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null; } @@ -93,7 +94,8 @@ class WebGLRenderTarget extends EventDispatcher { this.depthBuffer = source.depthBuffer; this.stencilBuffer = source.stencilBuffer; - this.depthTexture = source.depthTexture; + + if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone(); return this;