Skip to content

Commit

Permalink
WebGLMultipleRenderTargets fix copy method texture[i].isRenderTargetT…
Browse files Browse the repository at this point in the history
…exture and depthTexture.clone (mrdoob#23781)

Fixed MRT copy method:

- texture[i] needed `isRenderTargetTexture = true`
- Aligned the copy method of the depthTexture with WebGLRenderTarget (see mrdoob#23462)
  • Loading branch information
RenaudRohlinger authored and abernier committed Sep 16, 2022
1 parent 491ceb5 commit ddaa7ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderers/WebGLMultipleRenderTargets.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ class WebGLMultipleRenderTargets extends WebGLRenderTarget {

this.depthBuffer = source.depthBuffer;
this.stencilBuffer = source.stencilBuffer;
this.depthTexture = source.depthTexture;

if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();

this.texture.length = 0;

for ( let i = 0, il = source.texture.length; i < il; i ++ ) {

this.texture[ i ] = source.texture[ i ].clone();
this.texture[ i ].isRenderTargetTexture = true;

}

Expand Down

0 comments on commit ddaa7ff

Please sign in to comment.