KTX-Software icon indicating copy to clipboard operation
KTX-Software copied to clipboard

astc encoding lost normal-mode

Open wasimabbas-arm opened this issue 2 years ago • 4 comments

Since --normal-mode is only valid with ktx create --encode basis-lz | uastc there is no way to encode astc normals anymore. You will get;

ktx create fatal: Invalid use of argument --normal-mode that only applies to encoding.

If used with --format VK_FORMAT_ASTC_4x5_UNORM_BLOCK

wasimabbas-arm avatar Dec 04 '23 11:12 wasimabbas-arm

Clearly we need to have a think about how to support this for BasisU and ASTC. Anyone want to make a proposal?

MarkCallow avatar Dec 04 '23 13:12 MarkCallow

Shouldn't this just requires removing the coupling of --normal-mode with --encode for ASTC.

Actually why are these linked in the first place? Why can't I make an uncompressed KTX2, 2-component normal texture? As long as I know its 2-components, compressed or not I can recreate the 3rd component in the shaders.

wasimabbas-arm avatar Dec 04 '23 13:12 wasimabbas-arm

Shouldn't this just requires removing the coupling

Yes . But should be make a normal_mode_utils.h with these options or duplicate them where needed. Almost certainly we should make a utils file even though there are only 2 options.

Actually why is this coupled in the first place?

Excellent question. We (I) just never thought about it. This started out as a way to get better results from block compression schemes.

MarkCallow avatar Dec 04 '23 13:12 MarkCallow

Ok, how we implement them across different tools needs a bit of thinking. Agree collecting those into a norma_mode_utils.h makes sense.

If we are happy to have non-compressed normal mode normal map textures supported then un-linking from the --encode should immediately solve the ASTC issue. Of course the options needs to be traversed down into ASTC options for it to be used by the encoder.

abbaswasim avatar Dec 04 '23 13:12 abbaswasim