Răsfoiți Sursa

USDZExporter: Resize textures to 1024 by default.

Mr.doob 4 ani în urmă
părinte
comite
aa5bb104d2
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      examples/jsm/exporters/USDZExporter.js

+ 2 - 2
examples/jsm/exporters/USDZExporter.js

@@ -57,8 +57,8 @@ async function imgToU8( image ) {
 		( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {
 
 		const canvas = document.createElement( 'canvas' );
-		canvas.width = image.width;
-		canvas.height = image.height;
+		canvas.width = Math.min( 1024, image.width );
+		canvas.height = Math.min( 1024, image.height );
 
 		const context = canvas.getContext( '2d' );
 		context.drawImage( image, 0, 0, canvas.width, canvas.height );