提交 005c5ea1 编写于 作者: T Takahiro

GLTFExporter: Apply the review comment to forcePOT option

上级 b2753c00
...@@ -473,20 +473,16 @@ THREE.GLTFExporter.prototype = { ...@@ -473,20 +473,16 @@ THREE.GLTFExporter.prototype = {
var mimeType = map.format === THREE.RGBAFormat ? 'image/png' : 'image/jpeg'; var mimeType = map.format === THREE.RGBAFormat ? 'image/png' : 'image/jpeg';
var gltfImage = { mimeType: mimeType }; var gltfImage = { mimeType: mimeType };
if ( options.embedImages || ( options.forcePowerOfTwoTexture && ! isPowerOfTwo( map.image ) ) ) { if ( options.embedImages ) {
var canvas = cachedCanvas = cachedCanvas || document.createElement( 'canvas' ); var canvas = cachedCanvas = cachedCanvas || document.createElement( 'canvas' );
canvas.width = map.image.width; canvas.width = map.image.width;
canvas.height = map.image.height; canvas.height = map.image.height;
if ( options.forcePowerOfTwoTexture ) { if ( options.forcePowerOfTwoTexture && ! isPowerOfTwo( map.image ) ) {
if ( ! options.embedImages ) { console.warn( 'GLTFExporter: Resized non-power-of-two image.', map.image );
console.warn( 'GLTFExporter: image is not power of two. Resized and embedded.', image );
}
canvas.width = THREE.Math.floorPowerOfTwo( canvas.width ); canvas.width = THREE.Math.floorPowerOfTwo( canvas.width );
canvas.height = THREE.Math.floorPowerOfTwo( canvas.height ); canvas.height = THREE.Math.floorPowerOfTwo( canvas.height );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册