TGA files are used for some of the graphics in NWN. It is a uncompressed format which means no quality loss but a huge amount of speed and huge files when the image dimensions are even moderately big.
It has the lowest the lowest priority of texture formats usually, outranked by PLT then DDS (ie filename.dds will load over filename.plt which loads over filename.tga) but if you have the same DDS and TGA file at the same "level" the TGA loads first - see Content Load Order for more information.
File Format
NWN supports uncompressed 32bit TGA files with alpha. They must be powers of 2, such as 32x32 or 128x1024.
These are the sizes with filesize - because TGA is not compressed it gets big, fast. The larger sizes also tend to lag when loading by the engine due to the generation of mipmaps and transfer to the GPU inefficiently. See recommendations below - pretty much don't use TGA!
They can be uncompressed or compressed with RLE compression (using Bottom Left, not sure about Top Left). GIMP for instance can output compressed RLE which is up to half the size for some icons/textures.
Note that in some contexts, NWN does not appear to support grayscale TGA's; this has been tested in PBR maps (roughness, height, specular) loaded via MTR on creature and tile models. If affected by this issue you can simply convert the TGA to RGB format and it should work.
| Image Dimensions | Uncompressed | Image Dimensions | TGA File Size | Notes |
|---|---|---|---|---|
| 32x32 | 4KB | Game's default (now awful) icon size (eg; feats, spells). For new content use x2 (64x64) or x4 (128x128) due to UI scaling now being a thing. | ||
| 64x64 | 16KB | |||
| 128x128 | 64KB | |||
| 256x256 | 256KB | Maximum limit of certain shiny water effects. Retaining TGA for this might be advisable to improve quality slightly. But DDS works fine. | ||
| 512x512 | 1MB | |||
| 1024x1024 | 4MB | |||
| 2048x2048 | 12MB |
...
The TGA file format was used by Bioware to retain quality and compatibility due to the very early introduction of DDS. Therefore it got used for a large portion of the original game files. Once Hordes of the Underdark came around most usual textures were made in DDS only or original TGA ones were converted to DDS.
It might have at the time retained some quality - especially on tiny 32x32 icons - that DDS would have lost.@~85
Nowadays DDS should be used in 99% of cases. A higher quality DDS file scaled down by the engine or mipmapped to a suitable size is much better looking than the slow loading of a smaller dimension TGA. IE a 256x256 inventory icon in DDS looks and performs better than an 128x128 TGA, especially with the UI scaling nowadays. The fact that 256x256 DDS is 85KB but is 4x the pixels of the 128x128 64GB TGA also helps - a huge increase in pixels at a minimum increase of filesize!
It would be recommended if you did use DDS to include PNG or TGA source files, possibly of a higher resolution then the DDS, in case you need to rescale them later. You can also not load DDS files into the new NUI system so PNG equivalents is a good idea if they will be used in such a way (generally icons).
The only uses that still require TGA:
- The definitions for PLT files such as pal_skin01.tga used by the game, since these are read bit-by-bit and DDS may lower the quality (or does DDS even load for them?).
There may be other things, but well, that needs testing.
.
Due to quirks with the game engine and toolset this is a list of suitable uses of TGA. See also Textures for a full use case breakdown between formats.
| Type of Image | NWNEE TGA Required/Preferred | Notes |
|---|---|---|
| Mouse Cursors | Required | NWN:EE needs replacement and custom mouse cursors to be in TGA format |
| Item Icons | Required | TGA is used to validate that icons exist clientside (loading the icon at all) and serverside (eg in CopyItem), even if DDS can load once it's validated. The toolset also extensively relies on TGA being present and only loads TGA files. It also gets confusing since sometimes it needs a TGA to be present even if a PLT file would usually load. Go figure! |
| Palette definition files | Required | The toolset uses these files so to match the game use TGA |
| Portraits | Required for chargen | For new portraits TGA seems to be required (but only one size is needed now). See portraits.2da |
| Feat and Spell Icons | Not required (but can be preferred) | There is no reason to use TGA but it can help retain quality (especially if using the 32x32 standard icon size not a higher resolution version!), the toolset doesn't load these icons and they're not validated so it's reasonably safe to use DDS. |
| GUI Icons | Not required | Should load DDS fine, but as per Feat and Spell icons at 32x32 it's worth using TGA for quality, and sometimes even for higher resolution versions to retain quality at the cost of load times. |
| NUI Styling Images | Needs testing | nui_skin data can point to new image files. Need to test if these need to be TGA or can now be DDS instead |
...
| . |