Repository navigation
feat: EDDS volume textures, RG16F and RGBA16 - #53
Merged
Merged
Conversation
Some textures store a numeric D3DFORMAT in the FourCC field instead of a four character code. FourCCEnum now has the D3DFMT_* codes 36 and 110 to 116, and two of them are decoded: - Rg16Float (D3DFMT_G16R16F, DXGI_FORMAT_R16G16_FLOAT), clamped to 0..=1 for the 8 bit output like BC6H. - Rgba16 (D3DFMT_A16B16G16R16, DXGI_FORMAT_R16G16B16A16_UNORM), rounded to 8 bits. Volume textures (DDSCAPS2_VOLUME) are read with every slice: Mipmap has a depth that halves with the mipmaps, slices are decoded one by one and stored one after another. This covers the last two game textures that failed: system/textures/CurlNoise_F16.edds and the 32x32x32 color grading LUT system/textures/PP/base16_32x32_LUT.edds, both added to the test data.
Codecov Report❌ Patch coverage is
... and 46 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every
.eddsin the game paks now reads and decodes (29,139 files, 0 failures). The last two failures were:system/textures/CurlNoise_F16.edds: FourCC field holds112, the numericD3DFMT_G16R16F.system/textures/PP/base16_32x32_LUT.edds: a 32x32x32 volume texture (DDSCAPS2_VOLUME), FourCC field36(D3DFMT_A16B16G16R16). It's an identity color grading LUT: x is red, y green, the slice blue.Changes
FourCCEnum: numericD3DFMT_*codes 36 and 110 to 116, so these headers read.EddsFormat::Rg16FloatandEddsFormat::Rgba16, from the FourCC codes or the DX10 header (R16G16_FLOAT,R16G16B16A16_UNORM). For the 8 bit output RG16F is clamped to0..=1like BC6H (negative values become 0,RawEddskeeps the stored values), RGBA16 is rounded.Mipmap::depth(1 for 2D textures) that halves with the mipmaps. Slices are decoded one by one and stored one after another, so a decoded volume mipmap reads as awidthxheight * depthimage.Mipmapgets a public field, so code that builds aMipmapby hand needs to setdepth.The game's only volume texture has a single mip, so the depth halving across mip levels follows the DDS convention and is covered by synthetic tests only.
Tests
e-test-data-part-1.7z, checked by sample texels and checksums.