EFTB
EFTB
files define certain graphical effects of objects such as emissions, particles, and shaders.
EFTB File Layout
EFTB files are made up of a header and four arrays that are aligned to 16 bytes.
- Emitter Set Array
- Texture Array
- PRM[check] Array
- Shader Array
Each array serves as a root node in a tree structure.
EFTB Header
EFTB's header is 48 bytes and is not yet well-understood.
Header Structure
Offset (h) | Size | Data Type | Description |
---|---|---|---|
0x00 | 4 | String | file signature (magic) (45 46 54 42 or "EFTB")
|
0x04 | 4 | Unsigned Int | Unknown (00 00 00 14 )
|
0x08 | 4 | String | Unknown (47 61 6d 65 or "Game")
|
... |
Nodes
Each node in an array's tree structure is made up of a header and three optional sections.
- Binary data
- Attribute nodes[check]
- Child nodes
Node Header Structure
Node headers typically have the same 32-byte structure, though some are longer and some calculate certain values differently.
Offset (h) | Size | Data Type | Description |
---|---|---|---|
0x00 | 4 | Unsigned Int | Signature (magic) |
0x04 | 4 | Unsigned Int | Node size. Different node types calculate this differently. |
0x08 | 4 | Unsigned Int | Offset to the first child node, or FF FF FF FF if there are no children
|
0x0c | 4 | Unsigned Int | Offset to the next sibling node, or FF FF FF FF if there are no more siblings
|
0x10 | 4 | Unsigned Int | Offset to the first attribute[check], or FF FF FF FF if there are no attributes
|
0x14 | 4 | Unsigned Int | Offset to the binary data, or the size of the header |
0x18 | 4 | Padding | |
0x1c | 2 | Unsigned Short | Number of child nodes. Shaders' use of this value is unknown. |
0x1e | 2 | Unsigned Short | Unknown (00 01 )
|
Emitter Sets (ESTA)
The Emitter Set Array (ESTA) contains any number of Emitter Sets (ESET) as child nodes.
Emitter Set (ESET)
Emitter sets have 0x60 bytes of data consisting of 0x10 bytes of padding, a 0x40 byte block containing a 0-terminated string designating the name of the emitter set, and 0x10 bytes of unknown data.
Emitter sets also contain any number of Emitters (EMTR) as child nodes.
Emitter (EMTR)
Emitters (EMTR) cause an object to cast light on surrounding surfaces. They contain the following data:
Offset (h) | Size (h) | Description |
---|---|---|
0x00 | 0x60 | Name block, like in ESET |
0x60 | 0x18 | Six Unsigned Ints specifying the sizes of the color arrays
|
... | Unknown | |
0x420 | 0x80 | Color 0 array (eight sets of four 32-bit floats describing Red, Green, Blue, and Time) |
0x4a0 | 0x80 | Alpha 0 array |
0x520 | 0x80 | Color 1 array |
0x5a0 | 0x80 | Alpha 1 array |
0x620 | 0x40 | Unknown array |
0x660 | 0x80 | Scale[check] array |
... | Unknown | |
0xa08 | 0x10 | Constant Color 0 if Color 0 array is empty |
0xa18 | 0x10 | Constant Color 1 if Color 1 array is empty |
0xa28 | 0x30 | Unknown |
0xa58 | 0x60 | Three 0x20 blocks consisting of a 64-bit Unsigned Long Texture ID and 0x18 bytes padding |
0xab8 | 0x30 | Unknown |
Emitters can also have any number of attribute nodes (e.g. CADP, CSDP, FCSF), the purpose of which is currently unknown, as well as child emitter nodes.
Textures (TEXA)
The Texture Array (TEXA) contains any number of Textures (TEXR), with each texture containing a single GX2 Texture Block (GX2B). The TEXA tree is flattened such that all TEXR nodes appear first, followed by all of their child GX2B nodes.
(PRMA)
The PRMA[check] contains any number of PRIM[check] nodes.
Shaders (SHDA)
The Shader Array (SHDA) contains a single[check] GX2 Shader Block (SHDB).