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: Support ZSTD-compressed DataTexture and DataTexture3D #24398

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented Jul 29, 2022

Allows KTX2Loader to support ZSTD-compressed DataTexture and DataTexture3D with raw formats (u8, f16, f32).

I have also removed the UMD build, examples/js/KTX2Loader.js. At this point it would depend on three globals — WorkerPool, KTX, and ZSTDDecoder — which is starting to feel excessive. Originally it was added to help get support in A-Frame (aframevr/aframe#4919) but this hasn't happened, and I think it may be easier just to make a custom KTX2Loader build for A-Frame if necessary.

This type of compression is quite useful for things like LUTs — the table below shows example sizes for a typical 65x65x65 3D LUT texture.

format size
.cube 7.1 MB
.ktx2 + f32 1.0 MB
.ktx2 + f32 + zstd 90 KB

/cc @drcmda

@Mugen87 Mugen87 added this to the r144 milestone Aug 1, 2022
@mrdoob mrdoob merged commit b7143ee into mrdoob:dev Aug 2, 2022
@mrdoob
Copy link
Owner

mrdoob commented Aug 2, 2022

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Aug 2, 2022

This type of compression is quite useful for things like LUTs — the table below shows example sizes for a typical 65x65x65 3D LUT texture.

/fyi @elalish

@elalish
Copy link
Contributor

elalish commented Aug 2, 2022

This is cool! Is there a tool for compressing a LUT into KTX2?

@donmccurdy
Copy link
Collaborator Author

I don't have the ZSTD encoder working yet (use ktxsc to add compression in the meantime) but yeah, WIP:

https://lut-to-texture.glitch.me/

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.

4 participants