You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

KTX files are texture files used on mobile. Beamdog converted the base game files to KTX for that dataset. They sorta-kinda work on desktop but see notes below. They might also not work perfectly on mobile to be honest due to same issues.

Due to the specification it's not recommended to use them over DDS which especially for PBR files have much more optimal versions for space/efficiency/quality.

KTX Specification

The version the game loads is the ETC2 compression version used for OpenGL ES 3.0. This is a KTX1 texture format (the file name needs to be filename.ktx for the game to load it). ETC2 is similar to the BC type compression found in DDS files, as in it is the same size for each resolution.


The game only loads RGB and RGBA versions. This means no R or RG versions (well it tries to load them, but incorrectly as RGB or RGBA) so there is no efficiency saving for normal or spec/roughness maps. Even for basic normal maps they'll be much larger due to 3 channels. There is also no sRGB support, which is a higher quality version.

They load fine if set properly as per the tools below, but only for Diffuse and Normal maps. The Specular and Roughness do not appear to load properly at all compared to the DDS versions therefore it isn't usable for complete PBR mapping. Did not test illumination or other advanced PBR maps.

These are the types for OpenGL ES 3.0 with notes:

File SpecificationDefinitionNWN EE Notes
GL_COMPRESSED_R11_EAC11 bits for a single channel. Useful for single channel data where higher than 8 bit precision is needed. For example, heightmaps.
GL_COMPRESSED_SIGNED_R11_EACSigned version of GL_COMPRESSED_SIGNED_R11_EAC, useful when signed data is needed.
GL_COMPRESSED_RG11_EAC11 bits for two channels. Useful for two channel data where higher than 8 bit precision is needed. For example, normalised bump maps, the third component can be reconstructed from the other two components.
GL_COMPRESSED_SIGNED_RG11_EACSigned version of GL_COMPRESSED_RG11_EAC, useful when signed data is needed.
GL_COMPRESSED_RGB8_ETC28 bits for three channels. Useful for normal textures without alpha valuesThis is the standard non-alpha texture format NWNEE reads
GL_COMPRESSED_SRGB8_ETC2sRGB version of GL_COMPRESSED_RGB8_ETC2
GL_COMPRESSED_RGBA8_ETC2_EAC8 bits for four channels. Useful for normal textures with varying alpha values

This is the alpha texture format NWNEE reads

The game defaults to 0.5 alpha mean values for KTX textures.

GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EACsRGB version of GL_COMPRESSED_RGBA8_ETC2_EAC
GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC28 bits for three channels and a 1 bit alpha channel. Useful for normal textures with binary alpha valuesPunchthrough is not supported explicitly.
GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2sRGB version of GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.Punchthrough is not supported explicitly.

KTX Issues

Due to the above notes the specular and roughness maps don't appear to load in the PC version correctly (being all black/incorrect) whatever combination of KTX ETC2 version is used at least from my testing.

The mobile version of the game might load DDS files fine in some instances (converting them on the fly to KTX) however it seems it doesn't load all the PBR stuff perfectly so it's not a fix to just use DDS either.

KTX Tools

There are some tools used to test the game files for ETC2:

  • kram - command line converter. Can generate ETC2 files from PNG, much faster than other options.
  • ARM Mali Texture Compression Tool - This is now abandonware thus the link to the internet archive. Good side by side comparison and simple ETC2 selection if a bit weird UI. Very slow however!
  • PVR Tex Tool - I think can do ETC2 it's not quite clear from the config but posting just in case it's useful.

KTX2

Currently the follow on KTX2 format which has advanced algorithms to do smaller efficient files, with compression to boot, are not supported by the game. This would have been an improvement possibly on using DDS files in general!

Mainly this means more modern KTX tooling is geared towards this meaning the KTX Tools and NVIDIA tools and others are not going to work on NWNEE alas.

  • No labels