Line 19: |
Line 19: |
| |- | | |- |
| | 0x6 | | | 0x6 |
− | | 0x4 | + | | 0x2 |
| | CGFX header size | | | CGFX header size |
| |- | | |- |
− | | 0xA | + | | 0x8 |
− | | 0x2 | + | | 0x4 |
− | | ? | + | | Revision |
| |- | | |- |
| | 0xC | | | 0xC |
Line 83: |
Line 83: |
| |- | | |- |
| | 3 | | | 3 |
− | | Unknown | + | | Materials |
| |- | | |- |
| | 4 | | | 4 |
− | | Unknown | + | | Shaders |
| |- | | |- |
| | 5 | | | 5 |
Line 107: |
Line 107: |
| |- | | |- |
| | 11 | | | 11 |
− | | Unknown animations | + | | Visibility animations |
| |- | | |- |
| | 12 | | | 12 |
− | | Unknown | + | | Camera animations |
| |- | | |- |
| | 13 | | | 13 |
− | | Unknown | + | | Light animations |
| |- | | |- |
| | 14 | | | 14 |
− | | Unknown | + | | Emitters |
| |- | | |- |
| | 15 | | | 15 |
Line 146: |
Line 146: |
| |- | | |- |
| | 0xC | | | 0xC |
| + | | 0x4 |
| + | | ? |
| + | |- |
| | 0x10 | | | 0x10 |
| + | | 0x2 |
| + | | Unknown. Seems to be shifted left by 4 bits in the source. |
| + | |- |
| + | | 0x12 |
| + | | 0xA |
| | ? | | | ? |
| |} | | |} |
Line 175: |
Line 183: |
| | 0xC | | | 0xC |
| | 0x4 | | | 0x4 |
− | | Value (often offsets) | + | | Offset (self-relative) to object |
| |} | | |} |
| | | |
Line 560: |
Line 568: |
| | Position of this component within vertex stride | | | Position of this component within vertex stride |
| |} | | |} |
| + | |
| + | Vertex formats with bone data support multiple bone assignment. In this case, the sum of all bone weights is 0x64. |
| | | |
| Vertex component types: | | Vertex component types: |
Line 625: |
Line 635: |
| |} | | |} |
| | | |
− | Observed sample vertex formats:
| + | Vertex components are stored as one of the above data types, and the vertex component declaration contains a multiplier that adapts the values to the float version which the game will use. |
− | | + | For example, color RGBA values are stored as bytes, and the multiplier converts them from 0-255 to 0-1.0, and position components using short values are normalized via the multiplier to take advantage of the entire short value range. |
− | {| class="wikitable"
| |
− | |-
| |
− | ! Vertex stride
| |
− | ! Description
| |
− | |-
| |
− | | 0xA
| |
− | | X (short), Y (short), Z (short), U (short), V (short)
| |
− | |-
| |
− | | 0xC
| |
− | | X (float), Y (float), Z (float)
| |
− | |-
| |
− | | 0x10
| |
− | | X (short), Y (short), Z (short), ... ?
| |
− | |-
| |
− | | 0x14
| |
− | | X (float), Y (float), Z (float), U (float), V (float)
| |
− | |-
| |
− | | 0x18
| |
− | | X (float), Y (float), Z (float), Unk (u32?), U (float), V (float)
| |
− | |-
| |
− | | 0x20
| |
− | | X (float), Y (float), Z (float), NX (float), NY (float), NZ (float), U (float), V (float)
| |
− | |-
| |
− | | 0x28v1
| |
− | | X (float), Y (float), Z (float), NX (float), NY (float), NZ (float), U (float), V (float), (local) Bone IDs (4*u8), Bone weights (4*u8)
| |
− | |-
| |
− | | 0x28v2
| |
− | | X (float), Y (float), Z (float), NX (float), NY (float), NZ (float), U (float), V (float), Unk1 (u32), (local) Bone IDs (2*u8), Bone weights (2*u8)
| |
− | |}
| |
− | | |
− | Vertex formats with bone data support multiple bone assignment. In this case, the sum of all bone weights is 0x64.
| |
| | | |
| == TXOB == | | == TXOB == |
Line 676: |
Line 655: |
| | 0x4 | | | 0x4 |
| | Magic "TXOB" | | | Magic "TXOB" |
| + | |- |
| + | | 0x8 |
| + | | 0x8 |
| + | | ? |
| |- | | |- |
| | 0xC | | | 0xC |
Line 858: |
Line 841: |
| | | |
| CANMs are used to store skeletal animation data. | | CANMs are used to store skeletal animation data. |
| + | |
| + | == Tools == |
| + | * Every File Explorer |
| + | * Ohana3DS and its forks |
| + | * SPICA |
| | | |
| == Links == | | == Links == |
− | * Another CGFX Format Description: [http://florian.nouwt.com/wiki/index.php/CGFX_(File_Format) http://florian.nouwt.com/wiki/index.php/CGFX_(File_Format)] | + | * Another CGFX Format Description (Archived Page): [https://web.archive.org/web/20150511211029/http://florian.nouwt.com/wiki/index.php/CGFX_(File_Format) http://florian.nouwt.com/wiki/index.php/CGFX_(File_Format)] |
| + | |
| + | [[Category:File formats]] |