Skip to content

Commit ddaa7ff

Browse files
RenaudRohlingerabernier
authored andcommitted
WebGLMultipleRenderTargets fix copy method texture[i].isRenderTargetTexture 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)
1 parent 491ceb5 commit ddaa7ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/renderers/WebGLMultipleRenderTargets.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ class WebGLMultipleRenderTargets extends WebGLRenderTarget {
5959

6060
this.depthBuffer = source.depthBuffer;
6161
this.stencilBuffer = source.stencilBuffer;
62-
this.depthTexture = source.depthTexture;
62+
63+
if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();
6364

6465
this.texture.length = 0;
6566

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

6869
this.texture[ i ] = source.texture[ i ].clone();
70+
this.texture[ i ].isRenderTargetTexture = true;
6971

7072
}
7173

0 commit comments

Comments
 (0)