This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Determine internal format of given astc compressed image through its header!!

Hi Sean Ellis

I am writing a webgl based html application that uses astc compressed textures to be loaded on my triangle. I would like to know that does there exists a way to know whether the internal format of the compressed astc image(that in my case might be located on a remote web server) is linear or srgb encoded, by parsing the astc header. I can then use that internalFormat information obtained to pass my astc texture to glCompressedTexImage2D(). In other words, for eg. I want to know whether my internal format is "COMPRESSED_RGBA_ASTC_4x4_KHR" or "COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR" from the header of any astc compressed image. Any clues?

Thank you

Regards,

Deepak

Parents
  • > from the header of any astc compressed image

    What header? The ASTC payload itself doesn't have a header.

    It is possible to wrap your ASTC images in a KTX wrapper (or you could design your own) - that could carry the additional data - for example, but this isn't part of ASTC itself. The reason these constants exist at all at the API level is that the driver implementation cannot determine the format using just the ASTC binary blob .

    HTH,

    Pete

Reply
  • > from the header of any astc compressed image

    What header? The ASTC payload itself doesn't have a header.

    It is possible to wrap your ASTC images in a KTX wrapper (or you could design your own) - that could carry the additional data - for example, but this isn't part of ASTC itself. The reason these constants exist at all at the API level is that the driver implementation cannot determine the format using just the ASTC binary blob .

    HTH,

    Pete

Children