Przeglądaj źródła

Revert "RenderTarget: Fix copy of images. (#30570)" (#30572)

This reverts commit 2ab9aea318610820a3f5410c898eb56f8d6a9c29.
Michael Herzog 11 miesięcy temu
rodzic
commit
eb51e09194
2 zmienionych plików z 5 dodań i 6 usunięć
  1. 4 4
      src/core/RenderTarget.js
  2. 1 2
      src/textures/DepthTexture.js

+ 4 - 4
src/core/RenderTarget.js

@@ -148,12 +148,12 @@ class RenderTarget extends EventDispatcher {
 			this.textures[ i ].isRenderTargetTexture = true;
 			this.textures[ i ].renderTarget = this;
 
-			// ensure image object is not shared, see #20328
+		}
 
-			const image = Object.assign( {}, source.textures[ i ].image );
-			this.textures[ i ].source = new Source( image );
+		// ensure image object is not shared, see #20328
 
-		}
+		const image = Object.assign( {}, source.texture.image );
+		this.texture.source = new Source( image );
 
 		this.depthBuffer = source.depthBuffer;
 		this.stencilBuffer = source.stencilBuffer;

+ 1 - 2
src/textures/DepthTexture.js

@@ -1,6 +1,5 @@
 import { Texture } from './Texture.js';
 import { NearestFilter, UnsignedIntType, UnsignedInt248Type, DepthFormat, DepthStencilFormat } from '../constants.js';
-import { Source } from './Source.js';
 
 class DepthTexture extends Texture {
 
@@ -31,11 +30,11 @@ class DepthTexture extends Texture {
 
 	}
 
+
 	copy( source ) {
 
 		super.copy( source );
 
-		this.source = new Source( Object.assign( {}, source.image ) ); // see #30540
 		this.compareFunction = source.compareFunction;
 
 		return this;

粤ICP备19079148号