diff --git a/examples/jsm/loaders/KTX2Loader.js b/examples/jsm/loaders/KTX2Loader.js index f743cd400e54fb..1e0cd3650147e3 100644 --- a/examples/jsm/loaders/KTX2Loader.js +++ b/examples/jsm/loaders/KTX2Loader.js @@ -524,8 +524,8 @@ class KTX2Container { for ( var level = 0; level < this.header.levelCount; level ++ ) { - var levelWidth = Math.floor( width / ( 1 << level ) ) || 1; - var levelHeight = Math.floor( height / ( 1 << level ) ) || 1; + var levelWidth = Math.max( 1, Math.floor( width / Math.pow( 2, level ) ) ); + var levelHeight = Math.max( 1, Math.floor( height / Math.pow( 2, level ) ) ); var numImagesInLevel = 1; // TODO(donmccurdy): Support cubemaps, arrays and 3D. var imageOffsetInLevel = 0;