소스 검색

USDZExporter: Resize textures to 1024 by default.

Mr.doob 4 년 전
부모
커밋
aa5bb104d2
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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 );