CSharpImageLibrary
CSharpImageLibrary copied to clipboard
BC1/BC3 Loading Fail
Loading BC1/BC3 based DX10 formats either errors out, or shows incorrectly when doing preview.
I believe this has to do with setting the wrong BlockEncoder/Decoder for the format details. Also might want to make sure the blocksize is correct for BC1. (8 instead of 16)
I have attached 2 textures. One is dxt1_srgb (BC1_unorm_srgb) and the other is dxt5_srgb (BC3_unorm_srgb).
At present, I haven't properly implemented DX10 stuff, because I didn't need it. There's so many DX10 formats, so I was hoping I'd find time to figure out how to get DirectX to do the work for me. That said, BC1-5 should be simple enough since the decoders/encoders are the same as DX9. No timeframe on this fix though, sorry.
Also FYI (without checking), it's to do with the length of the header. DX9 = 128, DX10 = 148 (or something like that).
I ended up attempting to fix this myself. I have attached the file in case it will help you. Hopefully I didn't miss anything. This doesn't account for getting the proper colors for srgb based formats.
Thanks, hope it works for you. I'll take a look, although I plan on rewriting the underlying system that handles formats. It's difficult to add a new one, and it shouldn't be.