Skip to content

Commit

Permalink
WebGLRenderTarget: Clone depthTexture in copy(). (mrdoob#23462)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob authored and donmccurdy committed Mar 10, 2022
1 parent f5ea0d7 commit f60d1dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderers/WebGLRenderTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit f60d1dc

Please sign in to comment.