The .ftex format is a binary format used in conjunction with a variable number of .ftexs files (which is also a binary format) to store a texture in GZ and TPP. The .ftex file contains information on the texture (like the mipmap count, width, height, and depth (for 3D/Volume textures) of the texture) while the .ftexs files contain the raw texture data and information regarding it, such as chunk size, compressed or uncompressed, etc. Together, these files mostly just serve as a wrapper for ZLib-compressed DDS (DirectDraw Surface) files.
The Fox Engine uses textures in a completely standard way, but does store them differently. The .ftex file contains information about the texture as a whole and the .ftexs files, which contain the actual image data, albeit ZLib-compressed, have an extension number. Most textures will have a .1.ftexs, .2.ftexs, and a .3.ftexs, and all will have a .ftex. Most of the time, for quick loading, the .ftex and .1.ftexs (the lowest mipmaps are stored in this one) are stored in a .pftxs file in the chunk#.dat files with the rest of the game data, while all four files (.ftex, .1-3.ftexs) are stored in the texture#.dat files. This is not always true - notable exceptions include the Metal Gear Survive (SSD) beta and MGO, which store only the .2.ftexs and .3.ftexs files in the texture#.dat files.
The header is preceded by an array of mip map information blocks - one for each mipmap in the texture.
[1]What this flag does is unknown but it is 0x02 for all files except for ones suffixed with “_nrt”.
[2]What this flag does is unknown but for most files it is 0x111, for a very small amount of files it is 0x0, and for an extremely (almost no files have this flag) it is 0x11.
[3]This flag tells the game some information about texture. The flag is 0x01000001 for linear-space textures, 0x01000003 for sRGB-space textures, 0x01000007 for cubemap textures, and 0x01000009 for normal map textures.
If a given mipmap has a chunk count of 0, then it will use the entire file it references and will contain nothing but ZLib-compressed, raw DDS data of the given DDS format. If the chunk count is greater than one, each mipmap in a file will have an array (table) of chunk information entries, preceded by the data for that mipmap. Each mipmap chunk it its own zlib block; they can’t simply all be concatenated and deflated; each needs to be deflated prior to concatenation.
[1]This offset accounts for the size of the chunk information array, and adding the base offset (as specified in the .ftex file via the mipmap information) to the data offset yields the start of the image chunk data.
Name |
Suffix |
Description |
Additional Information |
---|---|---|---|
Base_Tex_SRGB, Layer_Tex_SRGB, MetalicLayer_Tex_SRGB |
bsm |
Albedo |
|
Base_Tex_SRGB |
bsm_alp |
Albedo w/ Alpha |
|
NormalMap_Tex_NRM |
nrm |
Normal |
|
NormalMap_Tex_NRM |
hnm |
Normal |
Unknown if there's a difference between these normal maps and the ones with the nrm suffix. |
SpecularMap_Tex_LIN |
srm |
Specular Occlusion / Roughness / Cubemap Mask |
R: Specular Mask, G: Roughness, B: Cubemap Mask |
Translucent_Tex_LIN |
trm |
Transmissive |
Transmissive map for subsurface scattering. |
MatParamMap_Tex_LIN |
mtm |
Material Parameter Map |
Used to apply multiple MatParamIndices to a single material. The indices are based on the following shades: 0: #212221 1: #606160 2: #9F9F9F 3: #E1DFE1 |
LayerMask_Tex_LIN |
lym |
Layer Mask |
Used in combination with a Layer_Tex_SRGB texture to overlay color. |
MetalicBacteria_Tex_LIN |
lbm |
Layer Mask |
Used in combination with a MetalicLayer_Tex_SRGB texture for parasite effects on Quiet and the Skulls. |
TensionSubNormalMap_Tex_NRM |
sub_nrm |
Subnormal |
Additional Normal map for added details. |
SubNormalMask_Tex_LIN |
sbm |
Subnormal Layer Mask |
|
Dirty_Tex_LIN |
dtm |
Blood/Dirt/Water Overlay |
R: Blood, G: Dirt, B: Water |
To convert a Fox Engine texture to a standard normal map, do the following:
To convert a texture from a standard normal map to the Fox Engine format, do the following:
The process to convert a standard normal map to the Fox Engine format in Gimp is similar.