Browse Source

GLTFExporter: Apply the review comment to forcePOT option

Takahiro 7 years ago
parent
commit
005c5ea18a
1 changed files with 3 additions and 7 deletions
  1. 3 7
      examples/js/exporters/GLTFExporter.js

+ 3 - 7
examples/js/exporters/GLTFExporter.js

@@ -473,20 +473,16 @@ THREE.GLTFExporter.prototype = {
 			var mimeType = map.format === THREE.RGBAFormat ? 'image/png' : 'image/jpeg';
 			var gltfImage = { mimeType: mimeType };
 
-			if ( options.embedImages || ( options.forcePowerOfTwoTexture && ! isPowerOfTwo( map.image ) ) ) {
+			if ( options.embedImages ) {
 
 				var canvas = cachedCanvas = cachedCanvas || document.createElement( 'canvas' );
 
 				canvas.width = map.image.width;
 				canvas.height = map.image.height;
 
-				if ( options.forcePowerOfTwoTexture ) {
+				if ( options.forcePowerOfTwoTexture && ! isPowerOfTwo( map.image ) ) {
 
-					if ( ! options.embedImages ) {
-
-						console.warn( 'GLTFExporter: image is not power of two. Resized and embedded.', image );
-
-					}
+					console.warn( 'GLTFExporter: Resized non-power-of-two image.', map.image );
 
 					canvas.width = THREE.Math.floorPowerOfTwo( canvas.width );
 					canvas.height = THREE.Math.floorPowerOfTwo( canvas.height );