Support all formats, cubemaps and arrays in DdsImporter, make it more robust#67
Conversation
d087733 to
bceb318
Compare
Codecov Report
@@ Coverage Diff @@
## master #67 +/- ##
==========================================
+ Coverage 95.73% 96.08% +0.35%
==========================================
Files 121 121
Lines 11955 11917 -38
==========================================
+ Hits 11445 11451 +6
+ Misses 510 466 -44
Continue to review full report at Codecov.
|
bceb318 to
61cd82e
Compare
6a5d565 to
24e3e1d
Compare
|
Major part of the changes is merged in 65381f8...ee51ae4. This again exploded way more than expected and motivation dried out. What remains is looking closer at ASTC and verifying with a second independent source, and cubemaps/arrays. Support for cubemaps, arrays, mips and especially combinations of those is either nonexistent or broken in majority of tools I tried, so it's not that important to be able to read them. When such a self-contained file is needed, it can be always easily extracted out of separately compressed DDS files and then combined into a KTX using |
96734f1 to
e12d402
Compare
Produced by NVTT Exporter.
Being more strict when checking legacy pixel formats (expecting also RGB(A) bits being set), clearly preferring the DXT10 header over legacy information, and making sure we handle cases of zero mip levels and zero depth robustly.
Otherwise it looked we're testing swizzle twice for no reason.
e12d402 to
e7a68a4
Compare
What was there was ... not working at all, mixing array slices and mip levels together, not importing cubemaps as 3D, .... I suppose that was because the code originated at a time where the importer interfaces had no support for mip levels, or the GL library no support for uploading cubemaps as a single 3D image, and so there wasn't really any other way to implement this. Also further tightening up various checks, like disallowing depths for non-3D textures, or failing if both 3D and cubemap flag is set.
KtxImporter does it like this, and it makes sense. Much less code that way, and it's not endlessly repeated for every mip level.
Instead of during every image access, which can be quite excessive when importing many mip levels. This is consistent with how KtxImporter does it.
Less mutability possibilities that way.
Consistently with basically all other image importers. This was a serious omission, however given the file format is most often used for block-compressed data (where we can't flip as easily yet), it was not *that* critical. The behavior is mostly consistent with what got invented by pezcode for KtxImporter. I just shamelessly compied most of the logic from there.
Basically mirroring the DdsImporter behavior. Once we have ASTC flipping implemented and/or an ability to control the imported orientation, the warnings will go away. Until then it's shitty like this.
e7a68a4 to
192d26e
Compare
This was all fun and games until I tried to open real-world files and realized it doesn't work at all. What needs to be done:
PixelFormatnow -- 2e71548Does DDS have any way to describe origin/coordinate system? I don't think so.No.assumeYUpsetting to not flip / hide the warningreworkingnot critically needed for this PRCompressedImage(View|Data)to check against those, similarly to whatImagedoes for pixels already