Browse Source

USDZExporter: Resize textures to 1024 by default.

Mr.doob 4 năm trước cách đây
mục cha
commit
aa5bb104d2
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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 );