BasisU: Update to 1.50.0 and add HDR support
Updates BasisUniversal to 1.50.0 and adds support for transcoding to BC6/ASTC HDR 4x4 RGB. If neither format is supported, the image gets decompressed to RGB9E5.
TODO:
- [x] Apply previous patches,
- [x] Use Godot's tinyexr,
- [x] Remove unused dependencies (qoi, tinydds)
- [x] Tune the settings to minimize the compression time,
- [x] Clean up the code,
- [x] Make the multiples-of-4 padding code account for RGBAF,
- [x] Do quality comparisons
Quality: Image: https://polyhaven.com/a/empty_play_room
| BasisU vs. Betsy (diff) | Basisu vs. Original (diff) |
|---|---|
I think this is more or less complete, on an optimized Windows editor build it adds ~250kb, this should be minimized by #85321.
The only big issue are the compression times, on an optimized build it takes ~21s to compress an 8k HDRi without mipmaps with the default settings. The latest push uses the 'fastest' preset which I haven't tested yet, so that may have improved a bit.
17 seconds sounds like our previous times without gpu compute, not sure how much we can squeeze to make it faster.
CVTT would take about 60-70s for the same task, so this is about 3x faster (though obviously still not desired)
Edit: It now takes ~15s, so changing the settings actually results in some improvement.
Edit2: Verbose mode now prints the encoding/transcoding times.
There are three missing items on the list left to go!
- [ ] Remove unused dependencies (qoi, tinydds)
- [ ] Tune the settings to minimize the compression time,
- [ ] Do quality comparisons
I don't think the performance can get any better (without SSE4/AVX), since the lowest settings are already used. Quality-wise, it's comparable to Betsy. Transcoding to ASTC should be nearly instant (BasisU HDR is just ASTC), so slowdowns are not expected on mobile. BC6 is slightly slower, though not really noticeable on Desktop hardware.
Regarding QOI support, we have #91263 so if it gets approved we could consider re-enabling support for that, if it's deemed useful.
BasisU's image loaders are never used anyway, nor are they exposed to the user; this would only simplify the patches.
Thanks!