Skip to content

Commit

Permalink
feat(ktx2): Support loading mipmaps in KTX2 textures (#2999)
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed May 20, 2024
1 parent a820827 commit f184da4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/textures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@loaders.gl/schema": "4.3.0-alpha.3",
"@loaders.gl/worker-utils": "4.3.0-alpha.3",
"@math.gl/types": "^4.0.1",
"ktx-parse": "^0.0.4",
"ktx-parse": "^0.7.0",
"texture-compressor": "^1.0.2"
},
"peerDependencies": {
Expand Down
1 change: 0 additions & 1 deletion modules/textures/src/lib/parsers/parse-basis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ function parseKTX2File(KTX2File, data: ArrayBuffer, options): TextureLevel[][] {

for (let levelIndex = 0; levelIndex < levelsCount; levelIndex++) {
levels.push(transcodeKTX2Image(ktx2File, levelIndex, options));
break; // texture app can only show one level for some reason
}

return [levels];
Expand Down
1 change: 1 addition & 0 deletions modules/textures/test/basis-loader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ test('BasisLoader#auto-select a decoder format', async (t) => {
});
const ktx2Image = ktx2Images[0];
t.ok(ktx2Image, 'Transcode .ktx2');
t.is(ktx2Image.length, 10, 'Transcode .ktx2 mips');

t.end();
});
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2651,7 +2651,7 @@ __metadata:
"@loaders.gl/schema": "npm:4.3.0-alpha.3"
"@loaders.gl/worker-utils": "npm:4.3.0-alpha.3"
"@math.gl/types": "npm:^4.0.1"
ktx-parse: "npm:^0.0.4"
ktx-parse: "npm:^0.7.0"
texture-compressor: "npm:^1.0.2"
peerDependencies:
"@loaders.gl/core": ^4.0.0
Expand Down Expand Up @@ -9771,10 +9771,10 @@ __metadata:
languageName: node
linkType: hard

"ktx-parse@npm:^0.0.4":
version: 0.0.4
resolution: "ktx-parse@npm:0.0.4"
checksum: 10c0/806d5005696c25147dcc9aa6a2033587041fb391c58faaecd88b94ad17b3edfc145d3d69746a218f569600e8e9c7116886e70251c5fd1c813086a093271643b2
"ktx-parse@npm:^0.7.0":
version: 0.7.0
resolution: "ktx-parse@npm:0.7.0"
checksum: 10c0/5953518c1c895ae05c8f12a22d46aadbd0885b6f018e82198d31085a73b6ffa351ab5d2ae740823a1eb503042a52d7e31cdb5cbf5ddbfcad819663b49f1fbf42
languageName: node
linkType: hard

Expand Down

0 comments on commit f184da4

Please sign in to comment.