{"name":"texHeaders.bin File Format","title":"texHeaders.bin File Format","type":"topic","url":"https://community.bistudio.com/wiki/texHeaders.bin_File_Format","revid":373423,"updated":"2025-05-08T11:27:12Z","aliases":[],"markdown":"> **Disclaimer: This page describes internal undocumented structures of Bohemia Interactive software.**\n>\n> This page contains unofficial information.\n>\n> Some usage of this information may constitute a violation of the rights of Bohemia Interactive and is in no way endorsed or recommended by Bohemia Interactive.\n> Bohemia Interactive is not willing to tolerate use of such tools if it contravenes any general licenses granted to end users of this community wiki or BI products.\n\n## intro\n\nTextHeaders.bin is created by Binpbo personal edition 2.5 and greater, or, mikero's dos tools.\n\nIt was introduced as of the arrowhead engine and builds an internal structure that was previously done by the engine at exe load time. It's basic use is to have an immediate index (in memory) of all mipmaps of all pax files in the game.\n\nThis internal structure is used in multiple ways, not just for pax files directly. Some of the settings therefore are constant and have no direct meaning to the pax file being analysed.\n\nThe file itself is placed in the primary folder of the addon.pbo, and comprises information from all pax files encountered in that addon. Unlike all other file\\references in bis, the ones used here are relative to the location of the texheaders.bin, not, the beginning if the 'P' drive.\n\n### creation\n\nis simple\n\n- BIS: some\\where\\binarise -texheaders project_folder project_folder\n- MIKERO: detex -C project_folder\n\n### Conventions\n\nsee Generic FileFormat Data Types\n\n## File Structure\n\n```\nstruct TexHeader.bin\n{\n MimeType \"0DHT\" ;    // NOT asciiz. '0' = 0x30. This is mimetype \"TexHeaDer0\"\n ulong    version;    // 1\n ulong    nTextures;  //\n TexBody  TexBodies[nTextures];\n};\n```\n\n### TexBody\n\n```\nTexBody\n{\n ulong          nColorPallets;      //always 1\n ulong          Pallet_ptr;         //Always0 (there are none)\n floats         AverageColor[r,g,b,a];//AVGCTAGG floating-point equivalent.\n bytes          AverageColor[b,g,r,a];//AVGCTAGG in PAx file\n bytes          MaxColor[b,g,r,a];    //MAXCTAGG in PAx file\n ulong          clampflags;         // always 0\n ulong          transparentColor;   // always 0xFFFFFFFF\n byteBool       has_maxCtagg;       // the MaxColor was set by the paa\n                isAlpha;         // set if FLAGTAG=1: 'basic transparency'\n                isTransparent;         // set if FLAGTAG=2: 'alpha channel is not interpolated'\n                isAlphaNonOpaque;   // set if isalpha, AND AverageColor alpha <0x80\n ulong          nMipmaps;           // always same as nMipmapsCopy below\n ulong          pax_format;         // see below Dxt1,2,3 etc\n byteBool       littleEndian;       // Always true;\n byte           isPaa;          //file was a .paa not .pac\n Asciiz         PaaFile[];          // Relative to the file location of the texheader itself.\n                                    //\"data\\icons\\m4a3_cco_ca.paa\"\n                                    //\"fnfal\\data\\fnfal_smdi.paa\"\n ulong          pax_suffix_type;    // _co, _ca, smdi, etc\n ulong          nMipmapsCopy;       // same as nMipmaps above\n MipMap         MipMaps[nMipmaps];  // see below\n ulong          SizeOfPaxFile;      //\n};\n```\n\n===pax_format===(not all values found in a pax file)\n\n0 Index Pallet (P8),\n\n1. Greyscale (AI88),\n1. RGB565,\n1. ARGB1555,\n1. ARGB4444,\n1. ARGB8888,\n1. DXT1\n1. DXT2\n1. DXT3,\n1. DXT4,\n1. DXT5\n\nThe same value is also repeated in each mipmap\n\n===pax_suffix_type=== (not all values found in a pax file)\n\n0 diffuse color, SRGB color space. the default for anything else\n\n1. diffuse color, linear color space: (_sky, _lco)\n1. detail texture, linear color space:(_detail,_cdt,_dt,_mco)\n1. normal map: (_nXXX)\n1. irradiance map\n1. Map with random values from interval <0.5, 1>\n1. tree crown calculation texture\n1. 'macro' object color, SRGB color space: (_mc)\n1. ambient shadow layer: (_as)\n1. Specular: amount of layer: (_sm, _smdi)\n1. dithering: texture\n1. detail specular: (_dtsmdi) amount of layer\n1. mask: (_mask) used for texture selection in the multi-shader\n1. Thermal Image: (_ti_ca) texture\n\n#### Color float\n\n```\nanyfloat= anybyte/255.0;\n```\n\n- note the order of floats is reverse to the rgba equivalent\n\n#### mipmap\n\n```\nMipMap\n{\n ushort width,height;            //as per same mipmap in the pax\n ushort Always0;\n byte   pax_format;              //same value as above\n byte   Always3;\n ulong  dataOffset;              //OFFSTAGG in PAx file. position of mipmap data in pax file\n};\n```","sections":[{"heading":null,"level":1,"markdown":"> **Disclaimer: This page describes internal undocumented structures of Bohemia Interactive software.**\n>\n> This page contains unofficial information.\n>\n> Some usage of this information may constitute a violation of the rights of Bohemia Interactive and is in no way endorsed or recommended by Bohemia Interactive.\n> Bohemia Interactive is not willing to tolerate use of such tools if it contravenes any general licenses granted to end users of this community wiki or BI products."},{"heading":"intro","level":2,"markdown":"TextHeaders.bin is created by Binpbo personal edition 2.5 and greater, or, mikero's dos tools.\n\nIt was introduced as of the arrowhead engine and builds an internal structure that was previously done by the engine at exe load time. It's basic use is to have an immediate index (in memory) of all mipmaps of all pax files in the game.\n\nThis internal structure is used in multiple ways, not just for pax files directly. Some of the settings therefore are constant and have no direct meaning to the pax file being analysed.\n\nThe file itself is placed in the primary folder of the addon.pbo, and comprises information from all pax files encountered in that addon. Unlike all other file\\references in bis, the ones used here are relative to the location of the texheaders.bin, not, the beginning if the 'P' drive."},{"heading":"creation","level":3,"markdown":"is simple\n\n- BIS: some\\where\\binarise -texheaders project_folder project_folder\n- MIKERO: detex -C project_folder"},{"heading":"Conventions","level":3,"markdown":"see Generic FileFormat Data Types"},{"heading":"File Structure","level":2,"markdown":"```\nstruct TexHeader.bin\n{\n MimeType \"0DHT\" ;    // NOT asciiz. '0' = 0x30. This is mimetype \"TexHeaDer0\"\n ulong    version;    // 1\n ulong    nTextures;  //\n TexBody  TexBodies[nTextures];\n};\n```"},{"heading":"TexBody","level":3,"markdown":"```\nTexBody\n{\n ulong          nColorPallets;      //always 1\n ulong          Pallet_ptr;         //Always0 (there are none)\n floats         AverageColor[r,g,b,a];//AVGCTAGG floating-point equivalent.\n bytes          AverageColor[b,g,r,a];//AVGCTAGG in PAx file\n bytes          MaxColor[b,g,r,a];    //MAXCTAGG in PAx file\n ulong          clampflags;         // always 0\n ulong          transparentColor;   // always 0xFFFFFFFF\n byteBool       has_maxCtagg;       // the MaxColor was set by the paa\n                isAlpha;         // set if FLAGTAG=1: 'basic transparency'\n                isTransparent;         // set if FLAGTAG=2: 'alpha channel is not interpolated'\n                isAlphaNonOpaque;   // set if isalpha, AND AverageColor alpha <0x80\n ulong          nMipmaps;           // always same as nMipmapsCopy below\n ulong          pax_format;         // see below Dxt1,2,3 etc\n byteBool       littleEndian;       // Always true;\n byte           isPaa;          //file was a .paa not .pac\n Asciiz         PaaFile[];          // Relative to the file location of the texheader itself.\n                                    //\"data\\icons\\m4a3_cco_ca.paa\"\n                                    //\"fnfal\\data\\fnfal_smdi.paa\"\n ulong          pax_suffix_type;    // _co, _ca, smdi, etc\n ulong          nMipmapsCopy;       // same as nMipmaps above\n MipMap         MipMaps[nMipmaps];  // see below\n ulong          SizeOfPaxFile;      //\n};\n```\n\n===pax_format===(not all values found in a pax file)\n\n0 Index Pallet (P8),\n\n1. Greyscale (AI88),\n1. RGB565,\n1. ARGB1555,\n1. ARGB4444,\n1. ARGB8888,\n1. DXT1\n1. DXT2\n1. DXT3,\n1. DXT4,\n1. DXT5\n\nThe same value is also repeated in each mipmap\n\n===pax_suffix_type=== (not all values found in a pax file)\n\n0 diffuse color, SRGB color space. the default for anything else\n\n1. diffuse color, linear color space: (_sky, _lco)\n1. detail texture, linear color space:(_detail,_cdt,_dt,_mco)\n1. normal map: (_nXXX)\n1. irradiance map\n1. Map with random values from interval <0.5, 1>\n1. tree crown calculation texture\n1. 'macro' object color, SRGB color space: (_mc)\n1. ambient shadow layer: (_as)\n1. Specular: amount of layer: (_sm, _smdi)\n1. dithering: texture\n1. detail specular: (_dtsmdi) amount of layer\n1. mask: (_mask) used for texture selection in the multi-shader\n1. Thermal Image: (_ti_ca) texture"},{"heading":"Color float","level":4,"markdown":"```\nanyfloat= anybyte/255.0;\n```\n\n- note the order of floats is reverse to the rgba equivalent"},{"heading":"mipmap","level":4,"markdown":"```\nMipMap\n{\n ushort width,height;            //as per same mipmap in the pax\n ushort Always0;\n byte   pax_format;              //same value as above\n byte   Always3;\n ulong  dataOffset;              //OFFSTAGG in PAx file. position of mipmap data in pax file\n};\n```"}],"categories":["Real Virtuality File Formats"],"groups":["Tools and File Formats"]}