Continuing my research on FIFA04-FIFA10 .o models, I will make some notes on FIFA11-FIFA16 .rx3 files.
RX3 general file structure
The file starts with a header:
The header is followed with chunk headers:
Chunk hashes:
Chunk data format is different for each chunk type.
So in general, RX3 file consists of file header, chunk headers and chunk data.
Depending on file content (texture container/simple model/hierarchical model/skinned model), a different list of sections is present in the file.
Texture containers
Texture containers (.rx3) usually consist of these chunks:
Texture containers for kits may also include RX3_CHUNK_HOTSPOT section.
RX3_CHUNK_TEXTURES_HEADER
This chunk contains a list of texture headers (basic information about texture) for each texture in the container.
This header is followed by texture headers (texture header represents basic information about texture):
RX3_CHUNK_TEXTURE
This chunk starts with texture header (Rx3TextureHeader), and continued with texture levels (mipmaps) for each texture face.
Texture level starts with a header:
This header is then followed by pixels data.
In general, the layout for texture chunk is following:
RX3_CHUNK_TEXTURE_BATCH
Collection of texture headers.
This header is then followed by texture headers (Rx3ChunkTexturesHeader).
RX3_CHUNK_NAMES
This chunk contains names for some objects. In texture containers it holds texture names. In other containers it might be used for other things.
The chunk data starts with a header:
Then the header is followed by name entries.
The name entry starts with a header:
The header is followed by a null-terminated name string.
RX3_CHUNK_HOTSPOT
This chunk contains positions for placing special things on the kit - numbers, crest etc. The chunk data starts with a header:
The header is followed by each area data:
Simple models
RX3_CHUNK_SIMPLE_MESH
There is a parameter inside the file which determines the primitive type (lines, tri-strips, tri-lists, etc.).
Known primitive types:
Other posts:
http://www.soccergaming.com/index.p...t-research-thread.6467750/page-2#post-6600063
http://www.soccergaming.com/index.p...t-research-thread.6467750/page-3#post-6600089
RX3 general file structure
The file starts with a header:
Code:
struct Rx3Header { // sizeof() = 16 bytes
char rx3id[3]; // "RX3"
char endian; // 'b' - big-endian, 'l' - little-endian
unsigned int version; // file/format version (4)
unsigned int totalSize; // total file size
unsigned int numberChunks; // number of sections
}
Code:
struct Rx3Chunk { // sizeof() = 16 bytes
unsigned int type; // chunk name hash, see Rx3ChunkHash
unsigned int offset; // offset in file to section data
unsigned int size; // size of data in bytes
unsigned int padding; // (0)
}
Code:
enum Rx3ChunkHash : unsigned int { // sizeof() = 4 bytes
RX3_CHUNK_TEXTURE_BATCH = 1808827868, // "texturebatch"
RX3_CHUNK_TEXTURE = 2047566042, // "texture"
RX3_CHUNK_VERTEX_BUFFER = 5798561, // "vb"
RX3_CHUNK_INDEX_BUFFER_BATCH = 582139446, // "ibbatch"
RX3_CHUNK_INDEX_BUFFER = 5798132, // "ib"
RX3_CHUNK_BONE_REMAP = 255353250, // "boneremap"
RX3_CHUNK_ANIMATION_SKIN = 3751472158, // "animationskin"
RX3_CHUNK_EDGE_MESH = 1843792843, // "edgemesh"
RX3_CHUNK_SIMPLE_MESH = 3566041216, // "simplemesh"
RX3_CHUNK_VERTEX_FORMAT = 3263271920, // "vertexformat"
RX3_CHUNK_NAME_TABLE = 1285267122, // "nametable"
RX3_CHUNK_LOCATION = 685399266, // "location"
RX3_CHUNK_HOTSPOT = 4116388378, // "hotspot"
RX3_CHUNK_MATERIAL = 123459928, // "material"
RX3_CHUNK_COLLISION = 4185470741, // "collision"
RX3_CHUNK_COLLISION_TRIMESH = 4034198449, // "collisiontrimesh"
RX3_CHUNK_SCENE_INSTANCE = 2116321516, // "sceneinstance"
RX3_CHUNK_SCENE_LAYER = 230948820, // "scenelayer"
RX3_CHUNK_SCENE_ANIMATION = 2360999927, // "sceneanimation"
RX3_CHUNK_MORPH_INDEXED = 3247952176, // "morphindexed"
// since FIFA 15
RX3_CHUNK_SKELETON = 1881640942, // "skeleton"
RX3_CHUNK_CLOTH_DEF = 283785394, // "clothdef"
// since FIFA 16
RX3_CHUNK_QUAD_INDEX_BUFFER_BATCH = 341785025, // "quadibbatch"
RX3_CHUNK_QUAD_INDEX_BUFFER = 191347397, // "qib"
RX3_CHUNK_BONE_NAME = 137740398, // "bonename"
RX3_CHUNK_ADJACENCY = 899336811 // "adjacency"
};
Chunk data format is different for each chunk type.
So in general, RX3 file consists of file header, chunk headers and chunk data.
Depending on file content (texture container/simple model/hierarchical model/skinned model), a different list of sections is present in the file.
Texture containers
Texture containers (.rx3) usually consist of these chunks:
Code:
RX3_CHUNK_TEXTURES_HEADER
RX3_CHUNK_TEXTURE (for each texture in container)
RX3_CHUNK_NAMES
RX3_CHUNK_TEXTURES_HEADER
This chunk contains a list of texture headers (basic information about texture) for each texture in the container.
Code:
struct Rx3ChunkTexturesHeader { // sizeof() = 16 bytes
unsigned int texturesCount; // number of textures in container
unsigned int unknown[3]; // maybe padding (0)
}
Code:
struct Rx3TextureHeader { // sizeof() = 16 bytes
unsigned int totalSize; // total size of Rx3 Texture chunk data (including texture header and pixels data)
unsigned char type; // Rx3TextureType
unsigned char baseFormat; // Rx3TextureBaseFormat
unsigned char dataFormat; // Rx3TextureDataFormat
char padding; // (0)
unsigned short width; // image width
unsigned short height; // image height
unsigned short depth; // faces count for cubemap or array textures (layers), 1 for 2D texture
unsigned short mips; // mipmap levels count
};
Code:
enum Rx3TextureType : unsigned char { // sizeof() = 1 byte
RX3_TEXTURE_1D = 0,
RX3_TEXTURE_2D = 1,
RX3_TEXTURE_3D = 2,
RX3_TEXTURE_CUBE = 3, // texture consists of 6 faces
RX3_TEXTURE_ARRAY = 4, // texture consists of multiple layers
RX3_TEXTURE_RAW = 5
}
Code:
enum Rx3TextureBaseFormat : unsigned char { // sizeof() = 1 byte
RX3_TEXFORMAT_DXT1 = 0,
RX3_TEXFORMAT_DXT3 = 1,
RX3_TEXFORMAT_DXT5 = 2,
RX3_TEXFORMAT_ARGB8888 = 3, // R8G8B8A8
RX3_TEXFORMAT_L8 = 4,
RX3_TEXFORMAT_AL8 = 5,
RX3_TEXFORMAT_RG8 = 6,
RX3_TEXFORMAT_RAW = 7,
RX3_TEXFORMAT_ATI2 = 7, // Switch; also known as BC5 compression
RX3_TEXFORMAT_ATI1 = 12, // Switch; also known as BC4 compression
}
Code:
enum Rx3TextureDataFormat : unsigned char { // sizeof() = 1 byte, bitset
RX3_TEXDATAFORMAT_LINEAR = 0x01,
RX3_TEXDATAFORMAT_BIGENDIAN = 0x02,
RX3_TEXDATAFORMAT_TILEDXENON = 0x04,
RX3_TEXDATAFORMAT_SWIZZLEDPS3 = 0x08,
RX3_TEXDATAFORMAT_REFPACKED = 0x80
}
RX3_CHUNK_TEXTURE
This chunk starts with texture header (Rx3TextureHeader), and continued with texture levels (mipmaps) for each texture face.
Texture level starts with a header:
Code:
struct Rx3TextureLevelHeader { // sizeof() = 16 bytes
unsigned int dataStride; // pitch
unsigned int dataHeight; // number of lines
unsigned int dataSize; // size of pixels data (dataStride * dataHeight)
unsigned int padding; // (0)
};
In general, the layout for texture chunk is following:
Code:
Texture header
FOR number of faces in texture
FOR number of levels in texture
Texture level header
Texture level pixels
END FOR
END FOR
RX3_CHUNK_TEXTURE_BATCH
Collection of texture headers.
Code:
struct Rx3TextureBatchHeader { // sizeof() = 16 bytes
unsigned int numberTextures;
unsigned int padding[3]; // (0)
};
RX3_CHUNK_NAMES
This chunk contains names for some objects. In texture containers it holds texture names. In other containers it might be used for other things.
The chunk data starts with a header:
Code:
struct Rx3ChunkNamesHeader { // sizeof() = 16 bytes
unsigned int totalSize; // total size of this section
unsigned int numStrings; // number of names
unsigned int padding[2]; // (0)
}
The name entry starts with a header:
Code:
struct Rx3NameEntryHeader { // sizeof() = 8 bytes
unsigned int type; // chunk ID of the object this name refers to (RX3_CHUNK_TEXTURE for texture names)
unsigned int size; // size of name string, including null-terminator
}
RX3_CHUNK_HOTSPOT
This chunk contains positions for placing special things on the kit - numbers, crest etc. The chunk data starts with a header:
Code:
struct Rx3SectionHotspotHeader { // sizeof() = 16 bytes
unsigned int totalSize; // total size of this section
unsigned char unknown1; // 1
unsigned char numAreas; // number of areas
unsigned char unknown2[2]; // maybe padding (0)
unsigned int unknown3[2]; // maybe padding (0)
}
Code:
string - area name, null-terminated string
unsigned char - number of hot-spots in area
for number of hot-spots in area
string - hot-spot name, null-terminated string
float[4] - hot-spot rectangle
Simple models
RX3_CHUNK_SIMPLE_MESH
There is a parameter inside the file which determines the primitive type (lines, tri-strips, tri-lists, etc.).
Code:
struct Rx3ChunkSimpleMesh { // sizeof() = 16 bytes
unsigned short primitiveType;
unsigned short unknown1; // usually 0
unsigned short unknown2; // usually 0
unsigned short unknown3; // usually 0
int unknown[2]; // padding (0, 0)
};
Code:
4 - TRIANGLELIST
6 - TRIANGLESTRIP
Other posts:
http://www.soccergaming.com/index.p...t-research-thread.6467750/page-2#post-6600063
http://www.soccergaming.com/index.p...t-research-thread.6467750/page-3#post-6600089
Last edited: