texconv: Added support for DXT5nm and RXGB DXT5 format variants #362
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.
The "DXT5nm" format is a "swizzled" DXT5/BC3 variant supported by a number of tools. It's intended to encode normal maps using BC3 which is supported on all Direct3D Hardware Feature levels rather than BC4/BC5 which originally was an ATI only extension and then part of Direct3D Hardware Feature Level 10.0. It encodes the 'x' as the alpha channel, 'y' as the green channel, sets the red channel to 1.0, and the blue channel to 0 to get good quality compression of both components.
The "RXGA" format is a "swizzled" DXT5/BC3 variant supported by a number of tools and popularized by Doom 3. It swaps the 'r' and 'a' channels, leaving 'g' and 'b' in place. This is normally written as "DXT5", but if
-f RXGB -dx9
is used, then it will write using the FourCC "RXGB" instead.The PR also adds support to the DirectXTex DDS codec for reading the numerous legacy FourCC's that are just 'swizzled' versions of BC3 or BC5. These are returned 'as is' so there's no logic to 'deswizzle' built-in. This should be handled by the client of the code, potentially using the
-swizzle
texconv switch.