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

KTX2Exporter: Fix metadata, add example #29541

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented Oct 2, 2024

Fixes some mistakes in KTX2Exporter-generated metadata, and adds an example closely based on the EXRExporter example. Tested by exporter PMREM textures and data textures, with output validated by https://github.com/KhronosGroup/KTX-Software.

# print info
ktx info texture.ktx2

# validate
ktx validate texture.ktx2

# extract to OpenEXR
ktx extract texture.ktx2 texture.exr

The raw float16 or float32 files exported from a PMREM texture tend to be large. They can be losslessly compressed with ZSTD to reduce the size somewhat...

ktxsc --zcmp 19 texture.ktx2

... but smaller file sizes would require more specialized compression, like BC6H or ASTC. The Basis Universal HDR UASTC spec, from Binomial, is a promising newer option available with KTX2 as well.

examples/misc_exporter_ktx2.html Fixed Show fixed Hide fixed
examples/misc_exporter_ktx2.html Fixed Show fixed Hide fixed
@Mugen87 Mugen87 added this to the r170 milestone Oct 2, 2024
@donmccurdy
Copy link
Collaborator Author

I believe the changes to KTX2Exporter here are correct and necessary, but I'm unsure about adding an example nearly identical to the current EXRExporter example. I do want to have an example, though... should I just use a different scene/texture?

@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 2, 2024

should I just use a different scene/texture?

That sounds good!

@donmccurdy
Copy link
Collaborator Author

Ok, done!

@donmccurdy donmccurdy merged commit b13d1b1 into mrdoob:dev Oct 3, 2024
11 checks passed
@donmccurdy donmccurdy deleted the fix/ktx2exporter-dfd-channels branch October 3, 2024 21:43
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.

2 participants