OBD:TXMP
|
|
|
TXMP is the only known instance type that is interpreted differently by the Oni engines for all three platforms (Windows, Mac and PS2).
The difference between the format used in v1.0 of the engine (Windows retail) and v1.1 (Windows demo, Mac, OniX) is minor, at least from the point of view of disk storage (the structural difference is limited to runtime fields grouped at the end of the instance, which is why they haven't been documented or implemented in OniSplit). A more obvious difference is that v1.0 TXMPs store their pixel data in the .raw file and v1.1 TXMPs use the .sep file, but as far as the .dat is concerned this merely amounts to using a different data pointer field within the TXMP structure. Thus, even though the template checksums for v1.0 and v1.1 are different, both formats can easily be described together.
The PS2 implementation is significantly different from the other two in that it systematically uses indexed colors: instead of color being stored in the pixel data itself, each pixel is merely an index into a custom 256-color palette. This format is detailed under § PS2 implementation.
Windows retail implementation
| Offset | Type | Raw Hex | Value | Description |
|---|---|---|---|---|
| 0x00 | res_id | 01 1F 00 00 | 31 | 00031-rl_1.TXMP |
| 0x04 | lev_id | 01 00 00 06 | 3 | level 3 |
| 0x08 | char[128] | rl_1 | name of the texture; unused | |
| 0x88 | int32 | 00 10 00 00 | 0x1000 | options; possible option flags (from left to right):
|
| 0x8C | int16 | 80 00 | 128 | width of the image in pixels |
| 0x8E | int16 | 80 00 | 128 | height of the image in pixels |
| 0x90 | int32 | 09 00 00 00 | 9 | texture format; see below for list of available formats.
|
| 0x94 | link | 00 00 00 00 | unused | link to a TXAN file; used if this texture is animated |
| 0x98 | link | 00 00 00 00 | unused | link to a TXMP file that contain the environment map |
| 0x9C | offset | 20 00 00 00 | 00 00 00 20 | offset of pixel data in the raw file (v1.0 engine only) |
| 0xA0 | offset | 00 00 00 00 | unused | offset of pixel data in the separate file (v1.1 engine only) |
| 0xA4 | uint32 | AD DE AD DE | dead | runtime; used for pointer to OpenGL texture name |
| 0xA8 | char[4] | AD DE AD DE | dead | padding |
| 0xAC | pad | AD DE | dead | post-instance alignment padding (not part of TXMP) |
Animation time
For animated textures marked with "random start", the starting frame will be picked randomly. This will prevent a set of animated textures which use the same TXMP from playing in unison, which could look unnatural if they are onscreen at the same time. If the "don't animate" flag is used in addition to "random start", a random frame will be selected and displayed statically.
Effect
The "blue shield", "invisibility" and "Daodan shield" options tell the engine to vary the texture's Gouraud shading with certain preset colors that vary with time. In the vanilla game data, these flags are only used by the following textures:
| Flag name | Texture with flag | Used for |
|---|---|---|
| "blue shield" | TXMPSHIELD | force shield |
| "invisibility" | TXMPINVIS | phase cloak |
| "Daodan shield" | TXMPDAODAN_SHIELD | red boss shield and supershield |
It should be noted that each of these textures is identical: a pure white 32x32 bitmap. The engine calls upon these textures by hardcoded name in order to create a character's shield or phase cloak effect, using the all-white pixels as a base to mix against various colors to produce the effects seen in-game.
Environment map
When the "has environment map texture" flag is set, 0x98 is expected to contain the index number of the "environment map", the texture to use for pseudo-reflections. When this flag is on, the texture (this one, not the env map) is expected to have an alpha channel. The alpha channel's values are then used to determine the visibility of the env map when the texture is drawn; thus the alpha channel is not being used for transparency in this case but rather as a mask or blend channel for the env map.
This can be understood better if looking at a texture with the flag such as Konoko's face – in most levels, including level1, this is TXMPIteration001/KS_face. When extracting this texture to a format which preserves the alpha channel you will see a nearly fully transparent image with only some brush strokes of color in the area of Konoko's hair. But if you strip the alpha channel from the image you will see Konoko's face. The reason for this is that the alpha value for most of the pixels in the TXMP is 0, thus the pixels are not displayed in a standard image viewer. But when a texture has the environment map flag the engine ignores the alpha channel when passing the texture to the graphics card, sending it the RGB channels only, then composites the env map over it using the alpha channel as a guide (an alpha that's above 0 means "show this much of the env map's pixel over top of the texture map's pixel").
Pixel byte storage order
As noted above under each format description, the bytes of multibyte texture formats are generally stored "backwards" compared to their names, so if a format is named "RGBA"-something then its bytes will be in ABGR order on disk. This convention was established in the Windows world where PCs were little-endian and loading the bytes AA BB GG RR into a 32-bit int in memory would place them in the correct order, 0xRRGGBBAA. Macintoshes, being big-endian at the time, expected the data to be stored in reverse order and thus Oni would perform a byte swap on most of these types when it loaded them into memory to ensure that they ended up as 0xRRGGBBAA in memory. The sole exceptions to this little-endian storage rule among Oni's supported texture formats are RGB_Bytes and RGBA_Bytes, which actually store their bytes in the stated order, RGB and RGBA respectively. However these formats were never used by any textures in Oni.
Pixel scanline storage order
Pixels are stored in row-major order, meaning that the pixels are stored in rows and then columns, as opposed to the other way around. These rows are stored in top-to-bottom order, contrary to what was documented on this wiki for a long time. In the case of the DXT1 storage format, the row-major, left-to-right, top-to-bottom order applies to the 4x4 blocks composing the image, and also inside each 4x4 block for the storage of 2-bit pixels. In the case of the I1 format (multiple pixels per byte), the row-major, left-to-right, top-to-bottom order applies to the 1-bit pixels composing the image.
Mac (and Windows demo) implementation
The v1.1 TXMP contains an inserted material type field at 0xA4, thus the end of TXMP looks like this:
| Offset | Type | Raw Hex | Value | Description |
|---|---|---|---|---|
| 0xA4 | int32 | 00 00 00 00 | dead | "material type" attributed at runtime (from TMBD), which is then used for impact/breakability lookup |
| 0xA8 | uint32 | AD DE AD DE | dead | runtime; used for pointer to OpenGL texture name |
| 0xAC | char[4] | AD DE AD DE | dead | runtime; holds an OpenGL-related "dirty" flag in the first byte and uses the next 3 bytes for flags) |
| 0xB0 | pad | AD DE | dead | post-instance alignment padding (not part of TXMP) |
You'll note that the 4 bytes of padding at the end of the v1.0 TXMP are now used for further runtime purposes, which does not change the total length of the instance data, but the template is 4 bytes larger due to the material type field.
PS2 implementation
The PS2 TXMP layout is similar to PC, with notable differences in the last few bytes due to Rockstar moving to a PS2-standard 32-bit indexed color ("CLUT") system for optimization purposes. Here are the high-level differences:
- There are 4 extra bytes of storage as compared to a v1.1 TXMP (which is already 4 bytes larger than a v1.0 TXMP).
- The extra 4 bytes come from a palette index (int32) inserted at 0x90 before the texture format (which is pushed down to 0x94 along with everything else that follows).
- Two new texture formats were added, and are the only formats used on PS2: type 16 for opaque textures (indexed 32-bit RGB with ignored alpha byte), and type 17 for transparent textures (indexed 32-bit RGBA).
- The pixel data (color indices) can be stored either in the .raw file (pointer field at 0xA0) or in the .sep file (pointer at 0xA4).
Here is how the end of TXMPrl_1 looks in level3_Final.dat of the English retail PS2 version.
| Offset | Type | Raw Hex | Value | Description |
|---|---|---|---|---|
| 0x90 | int32 | 56 00 00 00 | 86 | index of the 256-color palette used by this texture (starts at 0x15800 in level3_palette.pal) |
| 0x94 | int32 | 10 00 00 00 | 16 | texture format 16 (indexed 32-bit RGB with inactive alpha) |
| 0x98 | link | 00 00 00 00 | 0 | link to a TXAN file; used if this texture is animated |
| 0x9C | link | 00 00 00 00 | 0 | link to a TXMP file that contains the environment map |
| 0xA0 | offset | C0 05 00 00 | 00 00 05 C0 | offset of pixel data in the .raw file |
| 0xA4 | offset | 00 00 00 00 | 0 | offset of pixel data in the .sep file |
| 0xA8 | int32 | 00 00 00 00 | 0 | always 0; presumably the same "material type" (set at runtime) as for Windows demo and Mac |
| 0xAC | uint32 | AD DE AD DE | dead | presumably the same texture name pointer (set at runtime) as for Windows demo and Mac |
| 0xB0 | char[4] | AD DE AD DE | dead | presumably the same rendering optimization flags (runtime) as for Windows demo and Mac |
| 0xB4 | pad | AD DE | dead | post-instance alignment padding (not part of the template) |
Palette file format
- Palettes are stored per-level in level#_palette.pal files in a pal/ subdirectory of GameDataFolder, corresponding to how .raw and .sep files are stored in raw/ and sep/ subdirectories.
- Each level#_palette.pal file contains between 85 and 179 palettes, not counting the first palette (index 0) at the start of each .pal file which is always blank.
Palette format
- Valid palette indices start at 1 because of palette 0 always being empty.
- Each color in a palette entry is 4 bytes, stored on disk in RGBA order (byte 0 = red, byte 1 = green, byte 2 = blue, byte 3 = alpha). This is the same layout as RGB_Bytes (type 10) and RGBA_Bytes (type 11), not the reversed BGRA order used by most of the other texture formats.
- Each palette consists of 256 32-bit color slots and thus takes up 1024 bytes. If a palette does not use all 256 entries then the palette is closed out with a series of {0x00, 0x00, 0x00, 0x80} entries.
- Each pixel in the .raw or .sep data is stored as a 1-byte index into the image's chosen color palette.
Palette CLUT swizzle
- The PS2 Graphics Synthesizer (GS) stores CLUT entries in a scrambled order due to its hardware cache line layout. Within every 32-entry block of the palette, entries 8–15 and 16–23 are swapped relative to their logical positions. Software reading the palette must undo this before using it as a palette index.
Ignored alpha byte for type 16
- The fourth byte would represent alpha, but in RGB888 it is merely a padding byte, always set to 0x80.
Alpha scaling for type 17
- The PS2 GS uses a half-range alpha where 0x00 = fully transparent and 0x80 = fully opaque (values above 0x80 are technically possible but indicate "source alpha contribution > 1" in GS blending, which doesn't arise in Oni).
Alternating use of .raw or .sep storage
Unlike the v1.0 and v1.1 engines (where pixel data is either stored exclusively in .raw or exclusively in .sep for all TXMPs), PS2 TXMPs use .raw and .sep storage alternatingly, depending on the TXMP. The engine checks for pixel data using the .sep pointer if there is nothing in the .raw pointer (or vice versa).
Examples of textures using .sep storage are: all fly-in portraits, all splashscreen components, and some illustrations in Konoko's Data Comlink – namely, combat move illustrations and item illustrations; objectives and weapon illustrations use .raw storage. Environment/character/particle TXMPs seem to be using .raw storage consistently (based on a check of level0_Final and level1_Final).[4]
The PS2 engine has not been reverse-engineered very extensively so we can only speculate on why this division was made. But it's possible that the engine benefited from .sep files the same way that the v1.1 engine did on classic Macs (details here), namely that the .raw files were fully loaded into memory at level-load time and the .sep files had their contents loaded on-demand. Rockstar would have been contending with CD-ROM read speeds and seek times, and if the engine has the same limitation that it does on PC, it waits until a texture needs to be seen and then blocks on disk I/O until the texture has been read into memory. This was fine-ish on PCs with HDDs, but terrible for a disc-based game.
So Rockstar might have identified textures which could afford to slow down the game – such as splashscreens and images seen in the Comlink pause screen – and moved those to .sep, while textures for environments and particles were placed in the .raw so they would be kept "hot" (in the memory buffers) from level start. This would seem to be the only way for the PS2 port to work, as the amount of dropped frames from having to load all the TXMPs in a new scene as the player turned a corner in a level would have been very noticeable once the game data had been moved to CD-ROM. (The fact that so many textures presumably had to be kept hot on a system with such limited memory (32-36 MB) in turn necessitated a downgrade of texture quality, which was accomplished with the palette-based storage described earlier.)[5]
This theory on the workings of .sep files would explain most of the raw/sep division, even the reason why objective images are in .raw while most of the other Comlink images are in .sep – the Objective panel is the one that appears when you first pause the game. It does not explain why weapon images would be in .raw too, however.
Oni's internal storage types
Some of Oni's 18 types of image storage are elaborated on below in order to illustrate exactly how they work. The "Mem view" column shows the bytes in big-endian format and the "Disk view" column shows the bytes as they are actually stored in little-endian order. For example, bytes in memory shown as 0xFC00 are stored as "00 FC" on disk.
ARGB4444 (type 0)
- A 16-bit field is used to store 4 color channels (4 bits each, values from 0 to 15).
- Bit masks are 0x000F for Blue, 0x00F0 for Green, 0x0F00 for Red, 0xF000 for Alpha.
- Stored as big-endian in TXMP (first the AAAARRRR byte, then the GGGGBBBB byte).
Bits |
Byte 1 (high)7 6 5 4 3 2 1 0
|
Byte 0 (low)7 6 5 4 3 2 1 0
| ||
|---|---|---|---|---|
| Masks | A A A A R R R R |
G G G G B B B B
| ||
Bit values for primary colors (fully opaque) |
Mem view | Disk view | ||
| Black | 1 1 1 1 0 0 0 0 |
0 0 0 0 0 0 0 0
|
F0 00 | 00 F0 |
| White | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
FF FF | FF FF |
| Red | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0
|
FF 00 | 00 FF |
| Green | 1 1 1 1 0 0 0 0 |
1 1 1 1 0 0 0 0
|
F0 F0 | F0 F0 |
| Blue | 1 1 1 1 0 0 0 0 |
0 0 0 0 1 1 1 1
|
F0 0F | 0F F0 |
| Cyan | 1 1 1 1 0 0 0 0 |
1 1 1 1 1 1 1 1
|
F0 FF | FF F0 |
| Magenta | 1 1 1 1 1 1 1 1 |
0 0 0 0 1 1 1 1
|
FF 0F | 0F FF |
| Yellow | 1 1 1 1 1 1 1 1 |
1 1 1 1 0 0 0 0
|
FF F0 | F0 FF |
RGB555 (type 1)
- A 16-bit field is used to store 3 color channels (5 bits each, values from 0 to 31).
- Bit masks are 0x001F for Blue, 0x03E0 for Green, 0x7C00 for Red.
- The high bit (0x8000) is unused, but is always set to 1 by convention.
- Stored in little-endian order in TXMP.
Bits |
Byte 1 (high)7 6 5 4 3 2 1 0
|
Byte 0 (low)7 6 5 4 3 2 1 0
| ||
|---|---|---|---|---|
| Masks | X R R R R R G G |
G G G B B B B B
| ||
Bit values for primary colors |
Mem view | Disk view | ||
| Black | 1 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0
|
80 00 | 00 80 |
| White | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
FF FF | FF FF |
| Red | 1 1 1 1 1 1 0 0 |
0 0 0 0 0 0 0 0
|
FC 00 | 00 FC |
| Green | 1 0 0 0 0 0 1 1 |
1 1 1 0 0 0 0 0
|
83 E0 | E0 83 |
| Blue | 1 0 0 0 0 0 0 0 |
0 0 0 1 1 1 1 1
|
80 1F | 1F 80 |
| Cyan | 1 0 0 0 0 0 1 1 |
1 1 1 1 1 1 1 1
|
83 FF | FF 83 |
| Magenta | 1 1 1 1 1 1 0 0 |
0 0 0 1 1 1 1 1
|
FC 1F | 1F FC |
| Yellow | 1 1 1 1 1 1 1 1 |
1 1 1 0 0 0 0 0
|
FF E0 | E0 FF |
ARGB1555 (type 2)
- A 16-bit field is used to store 3 color channels (5 bits each, values from 0 to 31) and one 1-bit channel.
- Bit masks are 0x001F for Blue, 0x03E0 for Green, 0x7C00 for Red, and 0x8000 for Alpha.
Bits |
Byte 1 (high)7 6 5 4 3 2 1 0
|
Byte 0 (low)7 6 5 4 3 2 1 0
| ||
|---|---|---|---|---|
| Masks | A R R R R R G G |
G G G B B B B B
| ||
Bit values for primary colors (opaque) |
Mem view | Disk view | ||
| Black | 1 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0
|
80 00 | 00 80 |
| White | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
FF FF | FF FF |
| Red | 1 1 1 1 1 1 0 0 |
0 0 0 0 0 0 0 0
|
FC 00 | 00 FC |
| Green | 1 0 0 0 0 0 1 1 |
1 1 1 0 0 0 0 0
|
83 E0 | E0 83 |
| Blue | 1 0 0 0 0 0 0 0 |
0 0 0 1 1 1 1 1
|
80 1F | 1F 80 |
| Cyan | 1 0 0 0 0 0 1 1 |
1 1 1 1 1 1 1 1
|
83 FF | FF 83 |
| Magenta | 1 1 1 1 1 1 0 0 |
0 0 0 1 1 1 1 1
|
FC 1F | 1F FC |
| Yellow | 1 1 1 1 1 1 1 1 |
1 1 1 0 0 0 0 0
|
FF E0 | E0 FF |
A4I4 (type 6)
- An 8-bit field is used to store an intensity and an alpha (4 bits each, values from 0 to 15).
- Bit masks are 0x0F for Intensity, 0xF0 for Alpha.
- Endianness is irrelevant for single-byte storage.
| Bits | 7 6 5 4 3 2 1 0
| |
|---|---|---|
| Masks | A A A A I I I I
| |
| Examples of bit values | Mem view | |
| Black, opaque | 1 1 1 1 0 0 0 0
|
F0 |
| White, opaque | 1 1 1 1 1 1 1 1
|
FF |
| Black, transparent | 0 0 0 0 0 0 0 0
|
00 |
| White, transparent | 0 0 0 0 1 1 1 1
|
0F |
ARGB8888 (type 7)
- A 32-bit field is used to store 4 color channels (8 bits each, values from 0 to 255).
- Bit masks are 0x000000FF for Blue, 0x0000FF00 for Green, 0x00FF0000 for Red, 0xFF000000 for Alpha.
Bits |
Byte 3 (highest)7 6 5 4 3 2 1 0
|
Byte 2 (higher)7 6 5 4 3 2 1 0
|
Byte 1 (high)7 6 5 4 3 2 1 0
|
Byte 0 (low)7 6 5 4 3 2 1 0
| ||
|---|---|---|---|---|---|---|
| Masks | A A A A A A A A |
R R R R R R R R |
G G G G G G G G |
B B B B B B B B
| ||
Bit values for primary colors (fully opaque) |
Mem view | Disk view | ||||
| Black | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0
|
FF 00 00 00 | 00 00 00 FF |
| White | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
FF FF FF FF | FF FF FF FF |
| Red | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0
|
FF FF 00 00 | 00 00 FF FF |
| Green | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0
|
FF 00 FF 00 | 00 FF 00 FF |
| Blue | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
FF 00 00 FF | FF 00 00 FF |
| Cyan | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
FF 00 FF FF | FF FF 00 FF |
| Magenta | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
FF FF 00 FF | FF 00 FF FF |
| Yellow | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0
|
FF FF FF 00 | 00 FF FF FF |
RGB888 (type 8)
- A 32-bit field is used to store 3 color channels (8 bits each, values from 0 to 255).
- Bit masks are 0x000000FF for Blue, 0x0000FF00 for Green, 0x00FF0000 for Red.
- The high byte (0xFF000000) is unused, but is always set to 00 by convention.
Bits |
Byte 3 (highest)7 6 5 4 3 2 1 0
|
Byte 2 (higher)7 6 5 4 3 2 1 0
|
Byte 1 (high)7 6 5 4 3 2 1 0
|
Byte 0 (low)7 6 5 4 3 2 1 0
| ||
|---|---|---|---|---|---|---|
| Masks | X X X X X X X X |
R R R R R R R R |
G G G G G G G G |
B B B B B B B B
| ||
Bit values for primary colors |
Mem view | Disk view | ||||
| Black | 0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0
|
00 00 00 00 | 00 00 00 00 |
| White | 0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
00 FF FF FF | FF FF FF 00 |
| Red | 0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0
|
00 FF 00 00 | 00 00 FF 00 |
| Green | 0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0
|
00 00 FF 00 | 00 FF 00 00 |
| Blue | 0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
00 00 00 FF | FF 00 00 00 |
| Cyan | 0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
00 00 FF FF | FF FF 00 00 |
| Magenta | 0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
00 FF 00 FF | FF 00 FF 00 |
| Yellow | 0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0
|
00 FF FF 00 | 00 FF FF 00 |
RGB_Bytes (type 10)
- Three consecutive 8-bit fields are used to store 3 color channels (8 bits each, values from 0 to 255).
- Each channel has its own byte, and there is no "unused" byte (the bytes are packed 3 by 3).
- Endianness is irrelevant when storing as a sequence of bytes.
Bits |
Byte 0 (red)7 6 5 4 3 2 1 0
|
Byte 1 (green)7 6 5 4 3 2 1 0
|
Byte 2 (blue)7 6 5 4 3 2 1 0
| |
|---|---|---|---|---|
| Masks | R R R R R R R R |
G G G G G G G G |
B B B B B B B B
| |
| Bit values for primary colors | Mem view | |||
| Black | 0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0
|
00 00 00 |
| White | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
FF FF FF |
| Red | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0
|
FF 00 00 |
| Green | 0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0
|
00 FF 00 |
| Blue | 0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
00 00 FF |
| Cyan | 0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
00 FF FF |
| Magenta | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
FF 00 FF |
| Yellow | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0
|
FF FF 00 |
RGBA_Bytes (type 11)
- Four consecutive 8-bit fields are used to store 4 color channels (8 bits each, values from 0 to 255).
- Each channel has its own byte. Endianness is irrelevant when storing as a sequence of bytes.
Bits |
Byte 0 (red)7 6 5 4 3 2 1 0
|
Byte 1 (green)7 6 5 4 3 2 1 0
|
Byte 2 (blue)7 6 5 4 3 2 1 0
|
Byte 3 (alpha)7 6 5 4 3 2 1 0
| |
|---|---|---|---|---|---|
| Masks | R R R R R R R R |
G G G G G G G G |
B B B B B B B B |
A A A A A A A A
| |
Bit values for primary colors (fully opaque) |
Mem view | ||||
| Black | 0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
00 00 00 FF |
| White | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
FF FF FF FF |
| Red | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
FF 00 00 FF |
| Green | 0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
00 FF 00 FF |
| Blue | 0 0 0 0 0 0 0 0 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
00 00 FF FF |
| Cyan | 0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
00 FF FF FF |
| Magenta | 1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1
|
FF 00 FF FF |
| Yellow | 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 |
0 0 0 0 0 0 0 0 |
1 1 1 1 1 1 1 1
|
FF FF 00 FF |
Notes
- ↑ TSFT implicitly uses I8 for storing its glyphs in the PC versions, at least in most languages (the Chinese version has its own font storage system), but TSFT doesn't use TXMP to store its pixel data so it doesn't count as a use of this TXMP format type.
- ↑ Storage format 7 was jointly used by OniSplit, Daodan DLL and the Intel Mac build to allow for 32-bit textures with transparency - most importantly experimental lightmaps, see HERE. However, the actual storage format used in this case was RGBA_Bytes (type 11), and type 7 was used by mistake.
- ↑ Storage format 11 (RGBA_Bytes) was effectively implemented by OniSplit to allow for 32-bit textures with transparency - most importantly experimental lightmaps, see HERE. However, it was mislabeled as type 7 (ARGB8888) by OniSplit, Daodan DLL and the Intel Mac build, which resulted in byte swapping and the requirement of authoring Windows and Mac versions of TXMPs.
- ↑ As a notable anomaly, .sep storage is used for the following three console screens in level0_Final: _CON_SAVEGAME (main TXMP only; the animation frames use .raw storage), _CON_SAVEGAME_USED, _CON_USED. However only one of these textures is used in-game, _CON_USED.
- ↑ Additionally, it's possible that the texture memory-limit feature implemented for Macs was also used on PS2: this feature actively unloads any TXMPs that haven't been seen in a while in order to keep the total memory usage under a certain number. If this feature was in use, then under the theory above it would have made sense to use it for .sep-based TXMPs and not the .raw ones, which were always kept in memory – but it would have led to even more frame drops from having to re-load TXMPs that had already been loaded from a .sep and then discarded. Since most .sep textures were not time-critical because of where they were used, this would not have harmed game performance much.
| ONI BINARY DATA |
|---|
| TXMB << Other file types >> TxtC |
| TXMP : Texture Map |
| General file |

