Преглед изворни кода

KTX2Loader: Fix mipmaps width and height. (#25375)

* KTX2Loader exmaple - Transcode wrong mipmaps size #25339

* KTX2Loader exmaple - Transcode wrong mipmaps size #25339

* Update KTX2Loader.js

---------

Co-authored-by: Radek Zajkowski <[email protected]>
Co-authored-by: Michael Herzog <[email protected]>
RadZaj пре 2 година
родитељ
комит
367ff8a196
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      examples/jsm/loaders/KTX2Loader.js

+ 2 - 2
examples/jsm/loaders/KTX2Loader.js

@@ -475,8 +475,8 @@ KTX2Loader.BasisWorker = function () {
 			for ( let layer = 0; layer < layers; layer ++ ) {
 
 				const levelInfo = ktx2File.getImageLevelInfo( mip, layer, 0 );
-				mipWidth = levelInfo.origWidth;
-				mipHeight = levelInfo.origHeight;
+				mipWidth = levelInfo.origWidth < 4 ? levelInfo.origWidth : levelInfo.width;
+				mipHeight = levelInfo.origHeight < 4 ? levelInfo.origHeight : levelInfo.height;
 				const dst = new Uint8Array( ktx2File.getImageTranscodedSizeInBytes( mip, layer, 0, transcoderFormat ) );
 				const status = ktx2File.transcodeImage(
 					dst,