Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texconv: Added support for DXT5nm and RXGB DXT5 format variants #362

Merged
merged 4 commits into from Jun 12, 2023

Conversation

walbourn
Copy link
Member

@walbourn walbourn commented Jun 9, 2023

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.

@walbourn walbourn self-assigned this Jun 9, 2023
@walbourn walbourn linked an issue Jun 10, 2023 that may be closed by this pull request
@walbourn walbourn changed the title texconv: Added support for DXT5nm format texconv: Added support for DXT5nm and RXGB DXT5 format variants Jun 10, 2023
@walbourn walbourn requested a review from shawnhar June 10, 2023 17:25
@walbourn walbourn added tools Applies to texconv, texdiag, texassemble, etc. dds DirectDraw Surface (DDS) labels Jun 10, 2023
@walbourn walbourn merged commit a2a4ffd into main Jun 12, 2023
11 checks passed
@walbourn walbourn deleted the dxt5nm branch June 12, 2023 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dds DirectDraw Surface (DDS) tools Applies to texconv, texdiag, texassemble, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

question RXGB dtx5 support?
2 participants