texHeaders.bin File Format: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
Line 19: Line 19:
  TexBody
  TexBody
  {
  {
   ulong          Always1;
   ulong          nColorPallets;     //always 1
   ulong          Always0;
   ulong          Pallet_ptr;        //Always0 (there are none)
   floats        AverageColor[r,g,b,a];//[[PAA_File_Format#AVGCTAGG|AVGCTAGG]] floating-point equivalent. Note that order is different
   floats        AverageColor[r,g,b,a];//[[PAA_File_Format#AVGCTAGG|AVGCTAGG]] floating-point equivalent.
   bytes          AverageColor[b,g,r,a];//[[PAA_File_Format#AVGCTAGG|AVGCTAGG]] in PAx file  
   bytes          AverageColor[b,g,r,a];//[[PAA_File_Format#AVGCTAGG|AVGCTAGG]] in PAx file  
   bytes          MaxColor[b,g,r,a];    //[[PAA_File_Format#AVGCTAGG|MAXCTAGG]] in PAx file
   bytes          MaxColor[b,g,r,a];    //[[PAA_File_Format#AVGCTAGG|MAXCTAGG]] in PAx file
   ulong          Always0;
   ulong          clampflags;         // always 0
   ulong          AlwaysDefault;     // 0xFFFFFFFF
   ulong          transparentColor;   // always 0xFFFFFFFF
   byteBool      OnOff[4];           // 01 01 00 01 typical
   byteBool      has_maxCtagg;      // the MaxColor was set by the paa
                                    // 4th bool always set. 3rd bool seems related to NoAlphaWrite
                isAlpha;     // set if FLAGTAG=1: 'basic transparency'
   ulong          SameCount;         // always == nMipmaps
                isTransparent;     // set if FLAGTAG=2: 'alpha channel is not interpolated'
   ulong          TextureType;       // see below
                isAlphaNonOpaque;  // set if isalpha, AND AverageColor alpha <0x80
   byte          Always1;
   ulong          nMipmaps;           // always same as nMipmapsCopy below
   byte          Always1;
   ulong          pax_format;         // see below Dxt1,2,3 etc
   byteBool      littleEndian;      // Always true;
   Asciiz        PaaFile[];          //"data\icons\m4a3_cco_ca.paa"
   byte          isPaa;     //file was a .paa not .pac
   Asciiz        PaaFile[];          // '''Relative''' to the file location of the texheader itself.
                                    //"data\icons\m4a3_cco_ca.paa"
                                     //"fnfal\data\fnfal_smdi.paa"
                                     //"fnfal\data\fnfal_smdi.paa"
   ulong          SomeCount;         //Range 0..12. Might be bitflags
   ulong          pax_suffix_type;   // _co, _ca, smdi, etc
   ulong          nMipmaps;
   ulong          nMipmapsCopy;      // same as nMipmaps above
   MipMap        MipMaps[nMipmaps];
   MipMap        MipMaps[nMipmaps]; // see below
   ulong          EndOfMipMaps;       //offset in pax to last (dummy) mipmap
   ulong          SizeOfPaxFile;     //
  };
  };


* BIS have finally learned to use relative file addressing. This might be the precursor to a better future where we leave oops modelling nightmares behind.
 
===Texture Type===
===pax_format===(not all values found in a pax file)
values seen
 
*0 GREY
0 Index Pallet (P8),
*4  RGB4
#Greyscale (AI88),
*6  DXT1
#RGB565,
*10 DXT5
#ARGB1555,
this value is repeated in each mipmap
#ARGB4444,
#ARGB8888,
#DXT1
#DXT2
#DXT3,
#DXT4,
#DXT5
 
The same value is also repeated in each mipmap  
 
===pax_suffix_type=== (not all values found in a pax file)
 
0 diffuse color, SRGB color space. the default for anything else
# diffuse color, linear color space: (_sky, _lco)
#detail texture, linear color space:(_detail,_cdt,_dt,_mco)
#normal map: (_nXXX)
#irradiance map
#Map with random values from interval <0.5, 1>
#tree crown calculation texture
#'macro' object color, SRGB color space: (_mc)
#ambient shadow layer:  (_as)
#Specular: amount of layer: (_sm, _smdi)
#dithering: texture
#detail specular: (_dtsmdi) amount of layer
#mask: (_mask) used for texture selection in the multi-shader
#Thermal Image: (_ti_ca) texture
===Color float===
===Color float===
  anyfloat= anybyte/255.0;
  anyfloat= anybyte/255.0;
*note the order of floats is reverse to the rgba equivalent
===mipmap===
===mipmap===
  MipMap
  MipMap
  {
  {
   ushort width,ushort height;     //as per same mipmap in the pax
   ushort width,height;           //as per same mipmap in the pax
   ushort Always0;
   ushort Always0;
   byte  TextureType;             //same value as above
   byte  pax_format;             //same value as above
   byte  Always3;
   byte  Always3;
   ulong  dataOffset;              //[[PAA_File_Format#AVGCTAGG|OFFSTAGG]] in PAx file. position of mipmap data in pax file
   ulong  dataOffset;              //[[PAA_File_Format#AVGCTAGG|OFFSTAGG]] in PAx file. position of mipmap data in pax file

Revision as of 15:59, 4 August 2019

Template:unsupported-doc

intro

TextHeader.bin is created by Binpbo personal edition 2.5 and greater. It is placed in the primary folder of the addon.pbo, and comprises of information from all pax files encountered in that addon from all it's possible data trees.

Information here has been gleaned from the very few texheaders in Arrowhead (approx 24) and won't necessarily be complete as a result.

Conventions

see Generic FileFormat Data Types

File Structure

struct TexHeader.bin
{
 MimeType "0DHT" ;    // NOT asciiz. '0' = 0x30. This is mimetype "TexHeaDer0"
 ulong    version;    // 1
 ulong    nTextures;  // 
 TexBody  TexBodies[nTextures];
};

TexBody

TexBody
{
 ulong          nColorPallets;      //always 1
 ulong          Pallet_ptr;         //Always0 (there are none)
 floats         AverageColor[r,g,b,a];//AVGCTAGG floating-point equivalent.
 bytes          AverageColor[b,g,r,a];//AVGCTAGG in PAx file 
 bytes          MaxColor[b,g,r,a];    //MAXCTAGG in PAx file
 ulong          clampflags;         // always 0
 ulong          transparentColor;   // always 0xFFFFFFFF
 byteBool       has_maxCtagg;       // the MaxColor was set by the paa
                isAlpha;	     // set if FLAGTAG=1: 'basic transparency'
                isTransparent;	     // set if FLAGTAG=2: 'alpha channel is not interpolated'
                isAlphaNonOpaque;   // set if isalpha, AND AverageColor alpha <0x80
 ulong          nMipmaps;           // always same as nMipmapsCopy below
 ulong          pax_format;         // see below Dxt1,2,3 etc
 byteBool       littleEndian;       // Always true;
 byte           isPaa; 	     //file was a .paa not .pac
 Asciiz         PaaFile[];          // Relative to the file location of the texheader itself.
                                    //"data\icons\m4a3_cco_ca.paa"
                                    //"fnfal\data\fnfal_smdi.paa"
 ulong          pax_suffix_type;    // _co, _ca, smdi, etc
 ulong          nMipmapsCopy;       // same as nMipmaps above
 MipMap         MipMaps[nMipmaps];  // see below
 ulong          SizeOfPaxFile;      //
};


===pax_format===(not all values found in a pax file)

0 Index Pallet (P8),

  1. Greyscale (AI88),
  2. RGB565,
  3. ARGB1555,
  4. ARGB4444,
  5. ARGB8888,
  6. DXT1
  7. DXT2
  8. DXT3,
  9. DXT4,
  10. DXT5

The same value is also repeated in each mipmap

===pax_suffix_type=== (not all values found in a pax file)

0 diffuse color, SRGB color space. the default for anything else

  1. diffuse color, linear color space: (_sky, _lco)
  2. detail texture, linear color space:(_detail,_cdt,_dt,_mco)
  3. normal map: (_nXXX)
  4. irradiance map
  5. Map with random values from interval <0.5, 1>
  6. tree crown calculation texture
  7. 'macro' object color, SRGB color space: (_mc)
  8. ambient shadow layer: (_as)
  9. Specular: amount of layer: (_sm, _smdi)
  10. dithering: texture
  11. detail specular: (_dtsmdi) amount of layer
  12. mask: (_mask) used for texture selection in the multi-shader
  13. Thermal Image: (_ti_ca) texture

Color float

anyfloat= anybyte/255.0;
  • note the order of floats is reverse to the rgba equivalent

mipmap

MipMap
{
 ushort width,height;            //as per same mipmap in the pax
 ushort Always0;
 byte   pax_format;              //same value as above
 byte   Always3;
 ulong  dataOffset;              //OFFSTAGG in PAx file. position of mipmap data in pax file
};