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 qiweicao committed Apr 9, 2024
1 parent bf62afb commit 7233169
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 @@ -35,6 +35,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 @@ -101,7 +102,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 7233169

Please sign in to comment.