Author Topic: [Question]Texture formation of android version  (Read 442 times)

albert

  • *
  • Posts: 24
    • View Profile
[Question]Texture formation of android version
« on: 2023-08-01 14:33:12 »
Hi everyone,

I try to do something to FF8R android version and I saw lot of texture file formation is astcz, I don't know how to decompress/decode this, is some one know about it?

thanks.
« Last Edit: 2023-08-01 14:40:58 by albert »

Maki

  • 0xBAADF00D
  • *
  • Posts: 620
  • 0xCCCCCCCC
    • View Profile
Re: [Question]Texture formation of android version
« Reply #1 on: 2023-08-26 20:03:47 »
ASTC is texture compression format that is almost native to handheld/console devices. Personal computers with x86 architecture and typical Nvidia/AMD graphics cards have ZERO support for ASTC. Instead, the typical compression is DXT. Graphic cards in Nintendo Switch console, iOS and Androids have native support for ASTC. Now that's where it gets tricky. The consoles and mobiles read the ASTC files as-is. On Windows you rely only on CPU.
Anyway... ASTCZ is as far as I remember LZ4 compressed raw ASTC.
You have to decompress it via LZ4 algorithm by adding the LZ4 header to the file, then... I have no idea. There was a tool AMD's "Compressor" or something which was capable of re-encoding the ASTC files but I have no idea.
ASTC work on pixel blocks, sometimes even completely outside the typical 2-4-8 bit layout (like 6x6 bit blocks which produces non power of two numbers which are problematic)


Tl;dr - add LZ4 header, decompress and then I have no idea. That AMDs compressor might help.

EDIT:
https://gpuopen.com/compressonator/

EDIT2:
Found something better from ARM directly:
https://github.com/ARM-software/astc-encoder

It let's you decode texture to TARGA with both SDR and HDR support + re-encode back to ASTC
« Last Edit: 2023-08-26 21:43:13 by Maki »

albert

  • *
  • Posts: 24
    • View Profile
Re: [Question]Texture formation of android version
« Reply #2 on: 2023-08-27 13:42:45 »
ASTC is texture compression format that is almost native to handheld/console devices. Personal computers with x86 architecture and typical Nvidia/AMD graphics cards have ZERO support for ASTC. Instead, the typical compression is DXT. Graphic cards in Nintendo Switch console, iOS and Androids have native support for ASTC. Now that's where it gets tricky. The consoles and mobiles read the ASTC files as-is. On Windows you rely only on CPU.
Anyway... ASTCZ is as far as I remember LZ4 compressed raw ASTC.
You have to decompress it via LZ4 algorithm by adding the LZ4 header to the file, then... I have no idea. There was a tool AMD's "Compressor" or something which was capable of re-encoding the ASTC files but I have no idea.
ASTC work on pixel blocks, sometimes even completely outside the typical 2-4-8 bit layout (like 6x6 bit blocks which produces non power of two numbers which are problematic)


Tl;dr - add LZ4 header, decompress and then I have no idea. That AMDs compressor might help.

EDIT:
https://gpuopen.com/compressonator/

EDIT2:
Found something better from ARM directly:
https://github.com/ARM-software/astc-encoder

It let's you decode texture to TARGA with both SDR and HDR support + re-encode back to ASTC

Thank you for your help, I used Python and made a script to do that. this problem has solved.

They use Astcz file to make Android version can read high revolution texture, it's useful.