-
Notifications
You must be signed in to change notification settings - Fork 217
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 compressed textures, add example #2333
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example images are somewhat big.
- if only for an example we could load them from one of the
{deck.gl-data, loaders.gl}
repos. - The reason for adding them to this repo would be to use them in tests. If so recommend putting them in a test/data directory, such as
core/test/data/textures/...
and load them via rawgithub urls
This current image is 512x512 with mipmaps, without zstd compression to simplify the example. Particularly for the uncompressed RGBA8 sample I agree that's too large, and these images should be replaced. If you don't mind the image being trivial (8x8 color test grid?) we could keep the images under 1kb each. Or I could create more visually "interesting" images (name of each format on a colored background?) at moderate resolution, and then either compress them with ZSTD or host them somewhere else to avoid repository bloat. I'm happy to do any of those. I was hoping to write up a unit test as well, so probably having something small in this repo would be useful. Do you have any preference? Maybe both: trivial color blocks in this repository, and some more interesting samples (perhaps with ZSTD for size) hosted elsewhere. |
Sure. That said they are not THAT big. Just a few MB. If we use them in both unit tests and example then I think it is fine (the small extra bloat is "worth it" so to speak). |
Sounds good! I don't like the current images that much anyway – they say "ETC1S" because that's what they were generated from. I'll work up a cleaner/smaller set of images and update the PR, along with addressing the other couple comments. Thanks! |
@ibgreen I've cleaned up the example images — they're now all in the 1-2 KB range (rgba16 and rgba32 a little bigger), without zstd compression. Source files in https://github.com/donmccurdy/KTX2-Samples, with steps to regenerate them. Preview: currently etc2 fails, I haven't spent much time on that yet. rgba16 and rgba32 render without warnings but with many pixels out of place, but I think that is unrelated to the other changes here. |
Looks like CI is hanging, I tried to merge in master... |
@donmccurdy Tried to get the example to work, without success. |
Related:
Fixes rendering of compressed textures for ASTC4x4, BC1, BC3, BC5, BC7, and (uncompressed) RGBA8.
Not implemented yet:
Includes a minimal example, showing how to create a texture with compressed data extracted from a KTX2 file. Using loaders.gl instead of ktx-parse would of course be reasonable, but we need some fixes in loaders.gl as well, and luma.gl seemed like the place to start.