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

compressonatorcli not support BC1/2/3/6H/7_srgb format? #319

Open
tjb9821 opened this issue Jun 3, 2024 · 1 comment
Open

compressonatorcli not support BC1/2/3/6H/7_srgb format? #319

tjb9821 opened this issue Jun 3, 2024 · 1 comment

Comments

@tjb9821
Copy link

tjb9821 commented Jun 3, 2024

compressonatorcli not support BC1/2/3/6H/7_srgb format?

@nickreal03
Copy link

nickreal03 commented Jan 10, 2025

yeah I am also super curious and this... I am totally confused. It looks like everything is treated as linear. Which is fine... but would seem like you will lose precision for no reason at all... Knowing this supposed to be a quality SDK on how things should be done it feel strange... I feel like I am missing something from some where. But I do not know what... Also the DDS files are saved as linear which makes me feel like there is a horrible dark elephant in the room... Please help clarify this issue.

UPDATE:

OK I did bit more research...

The library assumes the the user tracks if the image is gamma or linear and ask the SDK for do the right things...
Independently if the input image could have known if it was a gamma texture or not.

Respect to the DDS file:
Seems like DDS is kind of a broken file format where people always assumed that texture using this formats were gamma. That is why in most viewers looks OK. Later on they added an additional header in the file call DX10 which added more detail format which supports _SRGB. But since everyone already assumed the old version everyone ignored it (as we can see in compressonator.

To fixed it you either have to:

Make sure your image serializes with the DX10 header by doing this, after the compression (just in case).
MipSetCompressed.m_dwFourCC = CMP_MAKEFOURCC('D', 'X', '1', '0');
Which will force the DDS serializer to add the header as explained.

Then you have 2 options:
a) fseek to DDS file to 128 and fwrite the correct format.
or
b) Write your own version of the DDS serializer.

I hope this helps someone...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants