Skip to content

Commit

Permalink
KTX2Loader: Improve readability of level size calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Don McCurdy committed Jan 9, 2021
1 parent 74658ba commit c21e5a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/jsm/loaders/KTX2Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c21e5a9

Please sign in to comment.