Browse Source

Texture: Set needsUpdate to true in copy(). (#23637)

* Texture: Set needsUpdate to true in copy().

* Fix WebGLMultipleRenderTargets.
Michael Herzog 3 years ago
parent
commit
6e55062dcf

+ 1 - 0
src/renderers/WebGLMultipleRenderTargets.js

@@ -13,6 +13,7 @@ class WebGLMultipleRenderTargets extends WebGLRenderTarget {
 		for ( let i = 0; i < count; i ++ ) {
 
 			this.texture[ i ] = texture.clone();
+			this.texture[ i ].isRenderTargetTexture = true;
 
 		}
 

+ 1 - 1
src/renderers/webgl/WebGLTextures.js

@@ -426,7 +426,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 		if ( texture.isVideoTexture ) updateVideoTexture( texture );
 
-		if ( texture.version > 0 && textureProperties.__version !== texture.version ) {
+		if ( texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version ) {
 
 			const image = texture.image;
 

+ 2 - 0
src/textures/Texture.js

@@ -136,6 +136,8 @@ class Texture extends EventDispatcher {
 
 		this.userData = JSON.parse( JSON.stringify( source.userData ) );
 
+		this.needsUpdate = true;
+
 		return this;
 
 	}