This is not official documentation. The information in this note has been compiled from my own research and investigation.
Artifact Graphics Hierarchy (.agh) is an image format used by MMO Istaria: Chronicles of the Gifted for the Artifact engine.
It is a container for the .dds image format, used to store textures for DirectX.
Istaria's AGH textures come in six different types:
This type uses a single byte per pixel, which stores Luminance. This allows a grayscale texture.
This type uses two bytes per pixel, which store Alpha and Luminance. This allows a grayscale texture with transparency.
This type uses three bytes per pixel, which store Rred, Green, and Blue. This allows a colored texture.
This type uses four bytes per pixel, which store Red, Green, Blue, and Alpha. This allows a colored texture with transparency.
This type is identical to type 7, but it has been compressed with BC1 compression. This type is deprecated.
This type is identical to type 7, but it has been compressed with BC2 compression. Textures generated with /aghdds
are of this type.
[AGH Header] - 128 bytes
[DDS Header] (if compressed) - 128 bytes
[Image]
Dword Empty: 00 00 00 00
[TYPE Dword]
Dword Width: The width of the texture.
Dword Height: The height of the texture.
Dword Mipmap Count: The number of mipmaps, including the original texture.
[Color Dword]
Dword Size of texture: The number of bytes describing the texture, including the surrounding [TYPE Dword] and [AGH Marker]
Dword Size of largest mipmap: Same as above, but for the largest mipmap
Dword Size of next largest mipmap
...
Dword Size of smallest mipmap
... (empty)
Dword Compressed: 10 00 00 00 if compressed, otherwise empty
9 * Dword Empty: 00 00 00 00
This dword stores the type of texture:
Uncompressed:
00 00 00 00
: Type 0 (8bpp)
03 00 00 00
: Type 3 (16bpp)
05 00 00 00
: Type 5 (24bpp)
07 00 00 00
: Type 7 (32bpp)
Compressed:
0E 00 00 00
: Type 14 (DXT1)
0F 00 00 00
: Type 15 (DXT3)
While the texture is being loaded, this ABGR color is displayed as a placeholder.
It represents the ABGR value of a pixel on the left edge of the image. The exact location of this pixel varies depending on the image size. In images of 32x, 64x, 128x, and 256x respectively, it is located at the appropriate white pixel shown here:
Istaria reads textures upside-down. All image data in an .agh is flipped vertically from its original image.
[TYPE Dword] - 4 bytes
[Image data]
[AGH Marker] - 4 bytes
[TYPE Dword] - 4 bytes
[Smallest mipmap]
[AGH Marker] - 4 bytes
[TYPE Dword] - 4 bytes
[Next smallest mipmap]
[AGH Marker] - 4 bytes
...
[TYPE Dword] - 4 bytes
[Largest mipmap]
[AGH Marker] - 4 bytes
[TYPE Dword] - 4 bytes
[Image data]
[AGH Marker] - 4 bytes
This dword is always the following, for any agh file:
DE EE ED DE
[DDS Header] - 128 bytes
[Image]
[Image data]
[Image data]
[Largest mipmap]
[Next largest mipmap]
...
[Smallest mipmap]