Dmitri
Reserves
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 section headers:
Section hashes:
Section data format is different for each section type.
So in general, RX3 file consists of file header, section headers and sections data.
Depending on file content (texture container/simple model/hierarchical model/skinned model), a different list of sections is presented in the file.
Texture containers
Texture containers (.rx3) usually consist of these sections:
Texture containers for kits may also include RX3_SECTION_HOTSPOT section.
RX3_SECTION_TEXTURES_HEADER
This section 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):
Known texture types:
Known texture formats:
RX3_SECTION_TEXTURE
This section 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 section is following:
RX3_SECTION_NAMES
This section contains names for some objects. In texture containers it holds texture names. In other containers it might be used for other things.
The section starts with a header:
Then the header is followed by names.
The name starts with a header:
The header is followed by a null-terminated name string.
RX3_SECTION_HOTSPOT
This section contains positions for placing special things on the kit - numbers, crest etc. The section starts with a header:
The header is followed by each area data:
Simple models
RX3_SECTION_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 signature[3]; // "RX3"
char endianness; // 'b' - big-endian, 'l' - little-endian
unsigned int version; // file version? (4)
unsigned int fileSize; // total file size
unsigned int sectionsCount; // number of sections
}
Code:
struct Rx3SectionHeader { // sizeof() = 16 bytes
unsigned int hash; // section name, see Rx3SectionHash
unsigned int dataOffset; // offset in file to section data
unsigned int dataSize; // size of data in bytes
unsigned int unknown; // maybe padding (0)
}
Code:
enum Rx3SectionHash : unsigned int { // sizeof() = 4 bytes
RX3_SECTION_TEXTURE_BATCH = 1808827868, // "texturebatch"
RX3_SECTION_TEXTURE = 2047566042, // "texture"
RX3_SECTION_VERTEX_BUFFER = 5798561, // "vb"
RX3_SECTION_INDEX_BUFFER_BATCH = 582139446, // "ibbatch"
RX3_SECTION_INDEX_BUFFER = 5798132, // "ib"
RX3_SECTION_BONE_REMAP = 255353250, // "boneremap"
RX3_SECTION_ANIMATION_SKIN = 3751472158, // "animationskin"
RX3_SECTION_EDGE_MESH = 1843792843, // "edgemesh"
RX3_SECTION_SIMPLE_MESH = 3566041216, // "simplemesh"
RX3_SECTION_VERTEX_FORMAT = 3263271920, // "vertexformat"
RX3_SECTION_NAME_TABLE = 1285267122, // "nametable"
RX3_SECTION_LOCATION = 685399266, // "location"
RX3_SECTION_HOTSPOT = 4116388378, // "hotspot"
RX3_SECTION_MATERIAL = 123459928, // "material"
RX3_SECTION_COLLISION = 4185470741, // "collision"
RX3_SECTION_COLLISION_TRIMESH = 4034198449, // "collisiontrimesh"
RX3_SECTION_SCENE_INSTANCE = 2116321516, // "sceneinstance"
RX3_SECTION_SCENE_LAYER = 230948820, // "scenelayer"
RX3_SECTION_SCENE_ANIMATION = 2360999927, // "sceneanimation"
RX3_SECTION_MORPH_INDEXED = 3247952176, // "morphindexed"
// since FIFA 15
RX3_SECTION_SKELETON = 1881640942, // "skeleton"
RX3_SECTION_CLOTH_DEF = 283785394, // "clothdef"
// since FIFA 16
RX3_SECTION_QUAD_INDEX_BUFFER_BATCH = 341785025, // "quadibbatch"
RX3_SECTION_QUAD_INDEX_BUFFER = 191347397, // "qib"
RX3_SECTION_BONE_NAME = 137740398, // "bonename"
RX3_SECTION_ADJACENCY = 899336811 // "adjacency"
};
Section data format is different for each section type.
So in general, RX3 file consists of file header, section headers and sections data.
Depending on file content (texture container/simple model/hierarchical model/skinned model), a different list of sections is presented in the file.
Texture containers
Texture containers (.rx3) usually consist of these sections:
Code:
RX3_SECTION_TEXTURES_HEADER
RX3_SECTION_TEXTURE (for each texture in container)
RX3_SECTION_NAMES
RX3_SECTION_TEXTURES_HEADER
This section contains a list of texture headers (basic information about texture) for each texture in the container.
Code:
struct Rx3SectionTexturesHeader { // 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 section (including texture header and pixels data)
unsigned char type; // Rx3TextureType
unsigned char format; // Rx3TextureFormat
unsigned short flags; // usually 1
unsigned short width; // image width
unsigned short height; // image height
unsigned short faces; // faces count for cubemap or volume textures (layers), 1 for 2D texture
unsigned short levels; // mipmap count
};
Known texture types:
Code:
enum Rx3TextureType : unsigned char { // sizeof() = 1 byte
RX3_TEXTURE_2D = 1,
RX3_TEXTURE_CUBEMAP = 3, // texture consists of 6 faces
RX3_TEXTURE_VOLUME = 4 // texture consists of multiple layers
}
Known texture formats:
Code:
enum Rx3TextureFormat : unsigned char { // sizeof() = 1 byte
RX3_TEXFORMAT_DXT1 = 0,
RX3_TEXFORMAT_DXT3 = 1,
RX3_TEXFORMAT_DXT5 = 2,
RX3_TEXFORMAT_R8G8B8A8 = 3,
RX3_TEXFORMAT_ATI2 = 7, // also known as BC5 compression
RX3_TEXFORMAT_ATI1 = 12, // also known as BC4 compression
}
RX3_SECTION_TEXTURE
This section 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 pitch;
unsigned int lines;
unsigned int levelSize; // size of pixels data (pitch * lines)
unsigned int padding; // 0;
};
In general, the layout for texture section 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_SECTION_NAMES
This section contains names for some objects. In texture containers it holds texture names. In other containers it might be used for other things.
The section starts with a header:
Code:
struct Rx3SectionNamesHeader { // sizeof() = 16 bytes
unsigned int totalSize; // total size of this section
unsigned int namesCount; // number of names
unsigned int unknown[2]; // maybe padding (0)
}
The name starts with a header:
Code:
struct Rx3NameHeader { // sizeof() = 8 bytes
unsigned int objectId; // ID of the object this name refers to (RX3_SECTION_TEXTURE for texture names)
unsigned int stringDataSize; // size of name string, including null-terminator
}
RX3_SECTION_HOTSPOT
This section contains positions for placing special things on the kit - numbers, crest etc. The section 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_SECTION_SIMPLE_MESH
There is a parameter inside the file which determines the primitive type (lines, tri-strips, tri-lists, etc.).
Code:
struct Rx3SectionSimpleMesh { // 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: