Skip to content

Commit 1c2625f

Browse files
committed
Put base into mipmaps. Push mipmaps as POJO (data, width, height)
1 parent a1e4527 commit 1c2625f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

examples/jsm/loaders/KTX2Loader.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,22 @@ class KTX2Loader extends Loader {
279279

280280
pendings.push( createDataTexture( container, levelIndex ).then( function ( dataTexture ) {
281281

282-
mipmaps[ levelIndex ] = {
283-
data: dataTexture.image.data,
284-
width: dataTexture.image.width,
285-
height: dataTexture.image.height
286-
};
282+
mipmaps[ levelIndex ] = dataTexture;
287283

288284
} ) );
289285

290286
}
291287

292288
await Promise.all( pendings );
293289

294-
const texture = mipmaps.shift();
295-
texture.mipmaps = mipmaps;
290+
const texture = mipmaps[0];
291+
texture.mipmaps = mipmaps.map(dt => {
292+
return {
293+
data: dt.source.data,
294+
width: dt.source.width,
295+
height: dt.source.height
296+
};
297+
});
296298
return texture;
297299

298300
}

0 commit comments

Comments
 (0)