The NNS TGA file format is a way of storing DS texture data inside a file that can be viewed by typical CG software. This makes it easier to see beforehand how certain texture compression parameters will affect the texture quality or apply particular conversion options to them.
NNS TGA files are usable by the NNS Blender Plugin, as well as the NNS export plugins for 3DS Max, Maya, and SoftImage. They can be produced by NitroPaint, OPTPiX iMageSutdio, and Photoshop with the export plugin.
To a typical decoder, an NNS TGA appears as a standard TGA image file. The only difference is that the ID string contains an identifier NNS_Tga Ver 1.0 (null-terminated) followed by a 32-bit offset to NNS texture data.
NNS Texture Data#
The NNS texture data appears at the end of the file and is pointed to by the ID string. This data takes the form of a series of blocks. Each block starts with an 8-byte string identifying the kind of block, followed by a 32-bit block length (including the block type and length fields). The types of blocks are outlined as follows:
Block | Description |
---|---|
nns_c0xp | A block with no data that indicates that the texture reserves color 0 for transparency. This only applies for texture formats palette4, palette16, and palette256. |
nns_ctbl | |
nns_cidx | |
nns_endb | A block with no data that marks the end of the NNS texture data. |
nns_frmt | Identifies the texture format used. This can be one of a3i5, palette4, palette16, palette256, a5i3, tex4x4, or direct. This is not null-terminated. |
nns_gnam | The texture's generator name (not null-terminated). Not used by converters. |
nns_gray | |
nns_gver | The generator version string (not null-terminated). Not used by converters. |
nns_imst | Data particular to OPTPiX iMageStudio. Not relevant to any other software. Data is only output for palette4, palette16, palette256, a3i5 and a5i3 textures. Its data takes on the form of a sequence of blocks. Each block begins with an 8-character block identifier followed by a 32-bit block length that includes the identifier and block length fields. Block identifiers used are imstplnm, imstcidx, imstatbl, and imstctbl. * imstctbl specifies the color palette as a sequence of 24-bit RGB values in R, G, B byte order. * imstatbl specifies the alpha channel of palette colors. iMageStudio handles a3i5 and a5i3 textures by duplicating the palette colors and varying the alpha channel. * imstcidx specifies the indexed image data. * imstplnm specifies something. |
nns_pcol | The texture palette colors. Can be omitted for textures that do not use a palette. |
nns_pidx | The palette index data for a tex4x4 texture. Can be omitted for all other texture formats. |
nns_pnam | The name of the texture palette as an ASCII string (not null-terminated). This string can be 16 characters at maximum. This only needs to be present in a texture file that contains a color palette. |
nns_pshp | Data particular to Photoshop. Not relevant to other software. |
nns_pver | |
nns_t44o | |
nns_txel | The texel data for this texture. |
nns_xpid |