How to load KTX textures at runtime?

I’ve tried handing Unity the ETC1 compressed data via LoadRawTextureData() but it loads a corrupted texture instead and only 1 mipmap level is loaded correctly. Are there any special measures I need to do to pass KTX texture data apart from removing the header?

I can’t help with the initial problem, but I wanted to let you know that in the meantime alternatives got developed:

  • Devlopment of KTX version 2.0 is close to be finished
  • The most exciting feature is Basis Universal supercompression, which allows platform-independant, efficient texture files that are transcoded into fitting GPU formats at run-time

I’ve created a Unity Package that lets you load KTX 2.0 files… Give it a spin and let me know if it works.

hth, atti