Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(textures): Support loading mipmaps in KTX2 textures #2999

Merged
merged 1 commit into from May 20, 2024

Conversation

donmccurdy
Copy link
Collaborator

Someone on the Web Game Dev Discord server reported that loaders.gl doesn't return any mipmaps for KTX2 textures. Appears to be a quick fix, and the returned data looks valid. I've updated ktx-parse to a newer version, while I'm here.

Screenshot 2024-05-10 at 10 42 24 AM

@@ -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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@belom88 or @ibgreen do you know what "texture app" refers to here? Is that something I would need to test before merging the PR?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this would be https://loaders.gl/examples/textures

@donmccurdy donmccurdy changed the title feat(ktx2): Support loading mipmaps in KTX2 textures feat(textures): Support loading mipmaps in KTX2 textures May 10, 2024
@ibgreen ibgreen requested a review from belom88 May 17, 2024 18:42
Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, actually wasn't aware that we had this gap.

Would be good to get a stamp from @belom88 who uses this loader in the tile converter

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this would be https://loaders.gl/examples/textures

@ibgreen ibgreen merged commit f184da4 into master May 20, 2024
1 check passed
@ibgreen ibgreen deleted the donmccurdy/fix-ktx2-load-mips branch May 20, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants