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

Support loading legacy DDS files using mixed channel formats #501

Merged
merged 7 commits into from
Aug 29, 2024

Conversation

walbourn
Copy link
Member

@walbourn walbourn commented Aug 29, 2024

The legacy DDS file formats D3DFMT_A2W10V10U10, D3DFMT_L6V5U5, and D3DFMT_X8L8V8U8 were originally not implemented because no DXGI format has a mix of signed/unsigned channels the way these legacy Direct3D 9 formats were made (the L and A channels are unsigned, the UVW channels are signed). They are also tied to legacy "BumpMap" technology, so generally weren't not considered that relevant to modern Direct3D.

There is a customer request that the library support loading these formats. For this PR, the unsigned values are remapped to the unorm range through biasing the value (i.e. effectively the same as x2 bias, but not applied to the L or A channels).

@walbourn walbourn added enhancement dds DirectDraw Surface (DDS) labels Aug 29, 2024
@walbourn walbourn self-assigned this Aug 29, 2024
@walbourn walbourn linked an issue Aug 29, 2024 that may be closed by this pull request
@walbourn
Copy link
Member Author

Test suite updates in this PR

@walbourn walbourn requested a review from shawnhar August 29, 2024 04:43
@walbourn
Copy link
Member Author

When completed, I need to update the tables on https://github.com/microsoft/DirectXTex/wiki/DDS-I-O-Functions

@walbourn walbourn merged commit 327c200 into main Aug 29, 2024
75 checks passed
@walbourn walbourn deleted the bumplummixedformats branch August 29, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dds DirectDraw Surface (DDS) enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

D3DFMT_X8L8V8U8 support (BumpDuDv/BumpLuminance)
2 participants