First, I have to say big thanks to Rom for all his work with paa/pac file format, this brief description is based on his early work...
PAA/PAC file format description:
First 2 bytes are texture format, possible values so far seen are:
01 FF - RGBA5551, DXT1 compressed texture
80 80 - IA88, Black&White texture with 8-bit alpha
44 44 - RGBA4444, RGB with alpha, 4 bits per component.
If you hex edit flashpoint EXE file, you can find strings hinting at some extra texture format besides these. If anyone has seen other texture types than ones listed above, please let us know!
Then comes header data. Header data is composed of 8 byte header tag, 4 byte header length and then header data itself. Note that header names are stored in file backwards, so that OFFSTAGG is stored as "GGATSFFO".
Possible header values seen so far are:
AVGCTAGG Average color of texture in RGBA8888 format (one DWORD). (?)used with with IA88 type textures(?)
OFFSTAGG Offsets to mipmaps in file, one DWORD each. Note that while 16 offsets are always stored, actual number of mipmaps might be smaller. In this case, offset is marked as 0x00000000.
FLAGTAGG Marks if texture contains transparency. Value 1 means basic transparency, 2 means alpha channel is not interpolated.
After last header, two zero bytes are stored.
Next follows mipmap data. For each mipmap, following header data is stored, followed by mipmap data.
Mipmap width - 2 bytes
Mipmap height - 2 bytes
Mipmap length - 3 bytes, length of compressed mipmap data
Next comes actual mipmap data:
- Texturetypes IA88 and RBGA4444 are compressed using same kind of compression as used in PBO files (LZ with 4k sliding window), followed by 4-byte checksum. I'll probably make compression/decompression source code available as soon as I've cleaned up code and tested them properly.
- DXTC1 textures are stored "as is", width*height/2 bytes.
Finally, last mipmap is followed by 5 zero bytes.
And now, OFP scene needs YOU! Since NVidia DXT converter and Photoshop plugin source code is available on Nvidia developer site for free, anyone can write their own PAC tools and Photoshop plugins...
Any volunteers? ***