|
@@ -76,7 +76,6 @@ THREE.GLTFExporter.prototype = {
|
|
embedImages: true,
|
|
embedImages: true,
|
|
maxTextureSize: Infinity,
|
|
maxTextureSize: Infinity,
|
|
animations: [],
|
|
animations: [],
|
|
- forcePowerOfTwoTextures: false,
|
|
|
|
includeCustomExtensions: false
|
|
includeCustomExtensions: false
|
|
};
|
|
};
|
|
|
|
|
|
@@ -224,19 +223,6 @@ THREE.GLTFExporter.prototype = {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * Checks if image size is POT.
|
|
|
|
- *
|
|
|
|
- * @param {Image} image The image to be checked.
|
|
|
|
- * @returns {Boolean} Returns true if image size is POT.
|
|
|
|
- *
|
|
|
|
- */
|
|
|
|
- function isPowerOfTwo( image ) {
|
|
|
|
-
|
|
|
|
- return THREE.MathUtils.isPowerOfTwo( image.width ) && THREE.MathUtils.isPowerOfTwo( image.height );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Checks if normal attribute values are normalized.
|
|
* Checks if normal attribute values are normalized.
|
|
*
|
|
*
|
|
@@ -781,15 +767,6 @@ THREE.GLTFExporter.prototype = {
|
|
canvas.width = Math.min( image.width, options.maxTextureSize );
|
|
canvas.width = Math.min( image.width, options.maxTextureSize );
|
|
canvas.height = Math.min( image.height, options.maxTextureSize );
|
|
canvas.height = Math.min( image.height, options.maxTextureSize );
|
|
|
|
|
|
- if ( options.forcePowerOfTwoTextures && ! isPowerOfTwo( canvas ) ) {
|
|
|
|
-
|
|
|
|
- console.warn( 'GLTFExporter: Resized non-power-of-two image.', image );
|
|
|
|
-
|
|
|
|
- canvas.width = THREE.MathUtils.floorPowerOfTwo( canvas.width );
|
|
|
|
- canvas.height = THREE.MathUtils.floorPowerOfTwo( canvas.height );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
var ctx = canvas.getContext( '2d' );
|
|
var ctx = canvas.getContext( '2d' );
|
|
|
|
|
|
if ( flipY === true ) {
|
|
if ( flipY === true ) {
|