Explorar o código

GLTFExporter: Fixed buildMetalRoughTexture. (#24197)

mrdoob %!s(int64=4) %!d(string=hai) anos
pai
achega
25e01cbcbd
Modificáronse 1 ficheiros con 2 adicións e 14 borrados
  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' );
 
 
 }
 }
 
 

粤ICP备19079148号