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

Add KTX2Exporter #24102

Merged
merged 2 commits into from
May 26, 2022
Merged

Add KTX2Exporter #24102

merged 2 commits into from
May 26, 2022

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented May 23, 2022

Adds support for exporting KTX 2.0 textures in uncompressed formats.

✅ Included:

  • Inputs: THREE.DataTexture, THREE.Data3DTexture, or THREE.WebGLRenderTarget
  • Types: UnsignedByteType, HalfFloatType, or FloatType
  • Formats: RGBAFormat, RGFormat, or RedFormat
  • Encodings: LinearEncoding or sRGBEncoding

⚠️ Not included:

  • GPU compression formats (ETC2, ASTC, etc.)
  • Supercompression (BasisLZ, ZSTD, ZLIB)

I hope to add support for lossless supercompression (likely ZSTD) in the future, but implementing Basis Universal compression here is not something I'm currently planning to work on. This PR is focused on lossless encoding of data textures, for somewhat different purposes. Perhaps GoogleChromeLabs/squoosh#1017 will be completed at some point for Basis Universal compression in web applications, that is a larger task.

@donmccurdy
Copy link
Collaborator Author

donmccurdy commented May 25, 2022

Support for loading these formats in KTX2Loader to be added in:

As a bit of motivation — any of the .cube 3D LUTs from this example can be reduced from 880kb to 130kb by using .ktx2 3D textures instead. That's without supporting zstd supercompression, which would likely reduce their size further.

@mrdoob mrdoob added this to the r141 milestone May 26, 2022
@mrdoob mrdoob merged commit 746f66b into mrdoob:dev May 26, 2022
@mrdoob
Copy link
Owner

mrdoob commented May 26, 2022

Thanks!

@donmccurdy donmccurdy deleted the feat-ktx2exporter branch May 26, 2022 13:44
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* KTX2Exporter: Initial commit

* KTX2Exporter: Keep relative import
@dbuck
Copy link
Contributor

dbuck commented Nov 30, 2022

@donmccurdy do you know which ktx-parse commit the built ktx-parse.module.js embedded here is from vs the previous version? I'm investigating an issue with loading my ktx2 files after a recent three upgrade that seems to be introduced here.

@dbuck
Copy link
Contributor

dbuck commented Nov 30, 2022

Pardon, forget that, the issue ended up being user error on my end after all ! 👋

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.

3 participants