texpresso icon indicating copy to clipboard operation
texpresso copied to clipboard

Support BC6 and BC7

Open kvark opened this issue 2 years ago • 1 comments

It would be great to implement support for these. I know it's very involved, and also already planned (based on the README). Current alternatives are scarce - basically bind to the monster of Intel Compressonator, which is it's own language and compiler, as well as a giant non-Rust dependency to carry. Has there be any attempt to implement a BC6/BC7 compressor? Even something bare-bones, to iterate on later, would be good.

For the context, I'm happily using texpresso to cook textures from user facing formats to BCn in Blade. The output of texpresso is cached on disk, so that loading can be instantaneous - just read from disk into GPU memory without any further processing. Now I need support for environment textures (coming in as EXR), and BC7 is the target. Thank you for the awesome work, and I hope to see texpresso grow!

kvark avatar May 24 '23 15:05 kvark

I was planning to start by transcribing the MIT/PD bc7enc for BC7. For BC6 the best starting point is probably bc6h_enc. Alternatively bc7enc_rdo could be worth a look for all BC formats, but that might require a license change in texpresso.

As an alternative I have been looking into compiling CMP_Core, i.e. the actual BCn compressor from Compressonator as a -sys crate and create safe bindings for it. (that would probably be a different project though, since it'd no longer be pure rust)

My attention has lately been more on getting the existing code to build with rust-gpu though so if you have time, any help with adding more formats is appreciated.

jansol avatar May 24 '23 16:05 jansol