Selaa lähdekoodia

WebGLMultipleRenderTargets fix copy method texture[i].isRenderTargetTexture and depthTexture.clone (#23781)

Fixed MRT copy method:

- texture[i] needed `isRenderTargetTexture = true`
- Aligned the copy method of the depthTexture with WebGLRenderTarget (see #23462)
Renaud Rohlinger 3 vuotta sitten
vanhempi
commit
b52c31666f
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      src/renderers/WebGLMultipleRenderTargets.js

+ 3 - 1
src/renderers/WebGLMultipleRenderTargets.js

@@ -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;
 
 		}