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

KTX2Loader: Add support for ASTC 6x6 format #26586

Merged
merged 3 commits into from
Aug 21, 2023

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented Aug 15, 2023

Related:

To create samples with KTX-Software v4.2:

# no supercompression
toktx --t2 --encode astc output.ktx2 input.png

# zstd supercompression
toktx --t2 --encode astc --zcmp 18 output.ktx2 input.png

ASTC is a GPU texture format, and works only on GPUs that support it — primarily mobile devices. ASTC is not a transcoded format like Basis Universal's UASTC, which would work on any device.

@donmccurdy
Copy link
Collaborator Author

donmccurdy commented Aug 15, 2023

Aside – it would be helpful to have more test cases for KTX2 support, we are supporting a fair number of input types at this point:

  • UASTC + THREE.CompressedTexture
  • ETC1S + THREE.CompressedTexture
  • DataTexture
  • DataArrayTexture
  • ASTC + THREE.CompressedTexture
  • LDR cubemap + THREE.CompressedCubeTexture
  • (future) HDR cubemap + THREE.CompressedCubeTexture

Do we have a preference about making one example with dropdown selection, vs. a number of KTX2 examples, vs. mixing KTX2 into existing examples where appropriate?

@CITIZENDOT
Copy link
Contributor

CITIZENDOT commented Aug 15, 2023

ASTC supports various block sizes: 4x4, 5x4, 5x5, 6x5, 6x6, 8x5, 8x6, 10x5, 10x6, 8x8, 10x8, 10x10, 12x10, 12x12. I think it's good idea to cover all the block sizes.

Edit: My bad, We don't have a way to test other block sizes. You're right. We can think about other blocksizes, if we have a way to create them.

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 15, 2023

Do we have a preference about making one example with dropdown selection, vs. a number of KTX2 examples, vs. mixing KTX2 into existing examples where appropriate?

Since there are already many examples, I would prefer a single KTX2 demo with a dropdown selection. That said, I think it's also fine to update one or two of the existing (glTF) examples so they are using KTX2Loader.

@Mugen87 Mugen87 added this to the r156 milestone Aug 19, 2023
@donmccurdy
Copy link
Collaborator Author

@CITIZENDOT Exactly — glad to support them, just not sure how to test it.

@Mugen87 I've added a dropdown with a number of small KTX2 2D texture samples for now. We're implementing KTX2 features that glTF files do not allow — ASTC, cubemaps, array textures, 3D textures, ... — so updating glTF examples won't help us here.

I have more samples to test (https://github.com/donmccurdy/KTX2-Samples), but have included only 2D textures in this PR.

@donmccurdy donmccurdy merged commit 530740c into mrdoob:dev Aug 21, 2023
@donmccurdy donmccurdy deleted the feat/ktx2loader-astc branch August 21, 2023 04:24
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.

KTX2Loader: Support for ASTC and ETC1 formats
3 participants