Browse Source

Fix WebGLRenderTarget.copy (#23997)

Garrett Johnson 3 years ago
parent
commit
4fc2942e0a
1 changed files with 3 additions and 1 deletions
  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 { LinearFilter } from '../constants.js';
 import { Vector4 } from '../math/Vector4.js';
+import { Source } from '../textures/Source.js';
 
 /*
  In options, we can specify:
@@ -82,7 +83,8 @@ class WebGLRenderTarget extends EventDispatcher {
 
 		// 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.stencilBuffer = source.stencilBuffer;