Closed pjako closed 3 years ago
It would be awesome to add codecs for some texture compression formats. I'll have to look into that.
Btw, dds supports seems to be available in the spectre package already. Never used that and I don't know if it is a help. https://github.com/johnmccutchan/spectre/tree/master/lib/src/spectre_asset_pack
Ok I think the decompressing is done in hardware, only the container is read in that code.
Yes it only reads the container. We only need encoding.
I wonder if doing a dart port of crunch ( https://code.google.com/p/crunch) would work... On Sep 16, 2014 12:06 PM, "Peter Jakobs" notifications@github.com wrote:
Yes it only reads the container. So in the end we only need encoding.
— Reply to this email directly or view it on GitHub https://github.com/brendan-duncan/image/issues/29#issuecomment-55796499.
Crunch would be nice for DXT and ETC.
Maybe this could be helpful: https://github.com/Mokosha/FasTC
That looks like a good candidate for porting, which I'd be glad to do, but the only problem with FasTC is that is has a very restrictive license, requiring explicit permission for commercial usage. Crunch has a much better license (ZLIB), I'll have to investigate how difficult the port will be.
There are multiple license files in the FasTC project can you link the one you are referring to?
I don't see any actual license files, I'm looking at the top comment in all of the source/header files which says:
That makes me a bit nervous... I wouldn't want to impose the requirement of written permission to anyone using the library for commercial purposes. Maybe it could be ported into a separate package outside of the image library, so it would be clearer to someone wanting to use it...
For ETC/DXT Rich Geldreichs work could be used.
For PVRTC may look into this: https://github.com/Volcore/quickpvr
The license on FasTC is to restrictive.
Cool, I'll check it out.
The QuickPVR project only has a PVRTC decompressor. What's with these formats with such limited support? So far the only people I've found that have worked on PVRTC compressors are FasTC and Rich Geldreichs (https://sites.google.com/site/richgel99/pvrtc-compression2), but it doesn't appear as though he ever got around to integrating it onto Crunch.
PVRTC is mostly for apple devices. Most of the compressors for these GPU formats are closed source. I guess most companies just use the compressor within xcode or the compiled library of imgtec. Update: There is also: http://roartindon.blogspot.de/2014/08/pvr-texture-compression-exploration.html
For port of the library, you can contact original author, and talk it over. This works on case-by-case basis AFAIK. He can give you completely different license for the port.
That's great. I'll look into expanding on Jeffery Lim's code for a PVRTC compressor. If I get stuck on that, I'll try contacting Pavel Krajcevski to see if he can be persuaded to a more lenient license for a port of FasTC. DXT and ETC compressors seem to be more plentiful, so they shouldn't be a problem. Now the only challenge is to find the time to do it, I should be able to squeeze a few hours here and there, I don't think it should take too long. I like a good challenge :-).
An update on PVRTC: I worked with Jeff Lim (from http://roartindon.blogspot.de/2014/08/pvr-texture-compression-exploration.html) and got his C++ realtime PVRTC encoder/decoder working, and will be finishing up the Dart port of that soon.
Nice to have both. I'm curious how the dart port will compare performance wise.
I got the PVRTC encoding and decoding working in Dart! So far I added the RGB_4BPP, and I'll finish adding the other formats, RGB_2BPP, RGBA_4BPP and RGBA_2BPP shortly. I also have a simple PVR format encoder, which is generating files that are loading correctly by PVRTexTool!
I'll start doing some benchmark tests against the C++ version too. That'll be interesting to see. I know there are a few places I can optimize the Dart code...I'll save that as an exercise for later.
I'll work on DXT and ETC after I wrap up PVRTC. I'm not expecting as much trouble with those as with PVRTC. Like with the PVRTC encoder, I'm planning on implementing the real-time variants of these, where the quality won't be quite as nice as the slow off-line compressors, but will be much faster, targeting on-the-fly compression.
BTW, I'm still working on this. Work got busy so updates will be slow for a bit.
I'll start doing some benchmark tests against the C++ version too. That'll be interesting to see. I know there are a few places I can optimize the Dart code...I'll save that as an exercise for later.
Hi Brendan:
Got around to do the benchmark?
(Personally I'd mostly be interested in large 16bit grayscale Tiff images.)
Sorry, I haven't.
Not sure this fits this library but: Support various GPU texture formats would be helpful for WebGL applications. ETC, PVRTC, S3TC/DXTC and maybe crunch. Not sure if its possible to write compression/decompression for all these formats in dart because some of them may have no public spec. Maybe it is easier to use binaries here.