Browse Source

GLTFExporter: Fixed buildMetalRoughTexture. (#24197)

mrdoob 3 years ago
parent
commit
25e01cbcbd
1 changed files with 2 additions and 14 deletions
  1. 2 14
      examples/jsm/exporters/GLTFExporter.js

+ 2 - 14
examples/jsm/exporters/GLTFExporter.js

@@ -343,27 +343,15 @@ function getPaddedArrayBuffer( arrayBuffer, paddingByte = 0 ) {
 
 
 }
 }
 
 
-let cachedCanvas = null;
-
 function getCanvas() {
 function getCanvas() {
 
 
-	if ( cachedCanvas ) {
-
-		return cachedCanvas;
-
-	}
-
 	if ( typeof document === 'undefined' && typeof OffscreenCanvas !== 'undefined' ) {
 	if ( typeof document === 'undefined' && typeof OffscreenCanvas !== 'undefined' ) {
 
 
-		cachedCanvas = new OffscreenCanvas( 1, 1 );
-
-	} else {
-
-		cachedCanvas = document.createElement( 'canvas' );
+		return new OffscreenCanvas( 1, 1 );
 
 
 	}
 	}
 
 
-	return cachedCanvas;
+	return document.createElement( 'canvas' );
 
 
 }
 }