瀏覽代碼

Fix WebGLRenderTarget.copy (#23997)

Garrett Johnson 3 年之前
父節點
當前提交
4fc2942e0a
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/renderers/WebGLRenderTarget.js

+ 3 - 1
src/renderers/WebGLRenderTarget.js

@@ -2,6 +2,7 @@ import { EventDispatcher } from '../core/EventDispatcher.js';
 import { Texture } from '../textures/Texture.js';
 import { Texture } from '../textures/Texture.js';
 import { LinearFilter } from '../constants.js';
 import { LinearFilter } from '../constants.js';
 import { Vector4 } from '../math/Vector4.js';
 import { Vector4 } from '../math/Vector4.js';
+import { Source } from '../textures/Source.js';
 
 
 /*
 /*
  In options, we can specify:
  In options, we can specify:
@@ -82,7 +83,8 @@ class WebGLRenderTarget extends EventDispatcher {
 
 
 		// ensure image object is not shared, see #20328
 		// ensure image object is not shared, see #20328
 
 
-		this.texture.image = Object.assign( {}, source.texture.image );
+		const image = Object.assign( {}, source.texture.image );
+		this.texture.source = new Source( image );
 
 
 		this.depthBuffer = source.depthBuffer;
 		this.depthBuffer = source.depthBuffer;
 		this.stencilBuffer = source.stencilBuffer;
 		this.stencilBuffer = source.stencilBuffer;