19,903
edits
(discovered this huge section commented out – I have restored it, tried to correct the broken parts, deleted the incomplete parts, and removed any mention of Macs being big-endian since that hasn't been true since two architecture migrations ago; the table markup is still pretty busted but it's functional) |
|||
| (6 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{OBD_File_Header | type=TXMP | prev=TXMB | next=TxtC | name=Texture Map | family= | {{OBD_File_Header | type=TXMP | prev=TXMB | next=TxtC | name=Texture Map | family=General | align=center}} | ||
TXMP is the only known instance type that is interpreted differently by the three kinds of Oni engines on the three plaftorms (Windows, Mac and PS2). | TXMP is the only known instance type that is interpreted differently by the three kinds of Oni engines on the three plaftorms (Windows, Mac and PS2). | ||
The difference between | 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 this merely amounts to using different fields within the same 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 8-bit index into a 256-color palette (palettes are stored per-level, in files named level0_palette.pal etc). This difference is detailed in a separate section at the bottom of the page. | 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 8-bit index into a 256-color palette (palettes are stored per-level, in files named level0_palette.pal etc). This difference is detailed in a separate section at the bottom of the page. | ||
==Windows and Mac TXMP== | ==Windows and Mac TXMP== | ||
[[Image:txmp_all.gif]] | |||
[[ | |||
| Line 36: | Line 35: | ||
{{OBDtr| 0x8E | int16 |C8FFC8| 80 00 | 128 | height of the image in pixels }} | {{OBDtr| 0x8E | int16 |C8FFC8| 80 00 | 128 | height of the image in pixels }} | ||
{{OBDtr| 0x90 | int32 |C8FFFF| 01 00 00 00 | 1 | texture format #1 (RGB555); see below for list of available formats. | {{OBDtr| 0x90 | int32 |C8FFFF| 01 00 00 00 | 1 | texture format #1 (RGB555); see below for list of available formats. | ||
:0 - ARGB4444, 16 bits/pixel (stored as a little- | :0 - ARGB4444, 16 bits/pixel (stored as a little-endian int16, swaps to big-endian at runtime on Mac) | ||
::Four 4-bit channels, with bitmasks 0x000F (Blue), 0x00F0 (Green), 0x0F00 (Red) and 0xF000 (Alpha). | ::Four 4-bit channels, with bitmasks 0x000F (Blue), 0x00F0 (Green), 0x0F00 (Red) and 0xF000 (Alpha). | ||
:1 - RGB555, 16 bits/pixel (stored as a little- | :1 - RGB555, 16 bits/pixel (stored as a little-endian int16, swaps to big-endian at runtime on Mac) | ||
::Three 5-bit channels, with bitmasks 0x001F (Blue), 0x03E0 (Green) and 0x7C00 (Red). | ::Three 5-bit channels, with bitmasks 0x001F (Blue), 0x03E0 (Green) and 0x7C00 (Red). | ||
:::N.B. The high bit (0x8000) is unused, but the convention is to always set it to 1. | :::N.B. The high bit (0x8000) is unused, but the convention is to always set it to 1. | ||
:2 - ARGB1555, 16 bits/pixel (stored as a little- | :2 - ARGB1555, 16 bits/pixel (stored as a little-endian int16, swaps to big-endian at runtime on Mac) | ||
::Three 5-bit channels with bitmasks 0x001F (Blue), 0x03E0 (Green) and 0x7C00 (Red), 1-bit alpha (0x8000). | ::Three 5-bit channels with bitmasks 0x001F (Blue), 0x03E0 (Green) and 0x7C00 (Red), 1-bit alpha (0x8000). | ||
:3 (never used in | :3 (never used in vanilla TXMPs) - I8, 8 bits/pixel, stored as a single byte. Monochrome "intensity" (256 levels of gray). | ||
:4 (never used in | :4 (never used in vanilla TXMPs) - I1, 8 pixels/byte. Pixel rows, bottom to top. Monochrome "intensity" (black-or-white). | ||
:5 (never used in | :5 (never used in vanilla TXMPs) - A8, 8 bits/pixel, stored as a single byte. Standalone alpha (256 levels of opacity). | ||
:6 (never used in | :6 (never used in vanilla TXMPs) - A4I4, 8 bits/pixel, stored as a single byte. Intensity (bit mask 0x0F), alpha (0xF0). | ||
:7 (never used in | :7 (never used in vanilla TXMPs<ref>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 [[Lightmapping_levels|HERE]]. However, the actual storage format used in this case was RGBA_Bytes (type 11), and type 7 was used by mistake.</ref>) - ARGB8888, 32 bits/pixel (stored as a little-endian int32, swaps to big-endian at runtime on a PowerPC Mac) | ||
::Four 8-bit channels, with bitmasks 0x000000FF (Blue), 0x0000FF00 (Green), 0x00FF0000 (Red) and 0xFF000000 (Alpha). | ::Four 8-bit channels, with bitmasks 0x000000FF (Blue), 0x0000FF00 (Green), 0x00FF0000 (Red) and 0xFF000000 (Alpha). | ||
:8 - RGB888, 32 bits/pixel (stored as a little- | :8 - RGB888, 32 bits/pixel (stored as a little-endian int32, swaps to big-endian at runtime on Mac) | ||
::Three 8-bit channels, with bitmasks 0x000000FF (Blue), 0x0000FF00 (Green) and 0x00FF0000 (Red). | ::Three 8-bit channels, with bitmasks 0x000000FF (Blue), 0x0000FF00 (Green) and 0x00FF0000 (Red). | ||
:::N.B. The high byte (0xFF000000) is unused, but the convention is to always set it to 0x00. | :::N.B. The high byte (0xFF000000) is unused, but the convention is to always set it to 0x00. | ||
:9 - S3TC/DXT1, RGB565 compressed 4 times ([https:// | :9 - S3TC/DXT1, RGB565 compressed 4 times ([https://wikis.khronos.org/opengl/S3_Texture_Compression GL_COMPRESSED_RGB_S3TC_DXT1_EXT] OpenGL texture format) | ||
:10 (never used in | :10 (never used in vanilla TXMPs) - RGB_Bytes, 24 bits/pixel, stored as 3 consecutive bytes: first Red, then Green, then Blue. | ||
::N.B. Unlike for RGB888 (type 8), the storage is compact, with no unused alpha bit. | ::N.B. Unlike for RGB888 (type 8), the storage is compact, with no unused alpha bit. | ||
:11 (never used in | :11 (never used in vanilla TXMPs<ref>Storage format 11 (RGBA_Bytes) was effectively implemented by OniSplit to allow for 32-bit textures with transparency - most importantly experimental lightmaps, see [[Lightmapping levels|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.</ref>) - RGBA_Bytes, 32 bits/pixel, stored as 4 consecutive bytes: first Red, then Green, then Blue, then Alpha. | ||
:12 (never used in | :12 (never used in vanilla TXMPs) - RGBA5551, 16 bits/pixel (stored as a little-endian int16, swaps to big-endian at runtime on Mac) | ||
::Three 5-bit channels with bitmasks 0x003E (Blue), 0x07C0 (Green) and 0xF800 (Red), 1-bit alpha (0x0001). | ::Three 5-bit channels with bitmasks 0x003E (Blue), 0x07C0 (Green) and 0xF800 (Red), 1-bit alpha (0x0001). | ||
:13 (never used in | :13 (never used in vanilla TXMPs) - RGBA4444, 16 bits/pixel (stored as a little-endian int16, swaps to big-endian at runtime on Mac) | ||
::Four 4-bit channels, with bitmasks 0x00F0 (Blue), 0x0F00 (Green), 0xF000 (Red) and 0x000F (Alpha). | ::Four 4-bit channels, with bitmasks 0x00F0 (Blue), 0x0F00 (Green), 0xF000 (Red) and 0x000F (Alpha). | ||
:14 (never used in | :14 (never used in vanilla TXMPs) - RGB565, 16 bits/pixel (stored as a little-endian int16, swaps to big-endian at runtime on Mac) | ||
::Two 5-bit channels with bitmasks 0x001F (Blue) and 0xF800 (Red), 6-bit Green channel (0x07E0). | ::Two 5-bit channels with bitmasks 0x001F (Blue) and 0xF800 (Red), 6-bit Green channel (0x07E0). | ||
:15 (never used in | :15 (never used in vanilla TXMPs) - ABGR1555, 16 bits/pixel (stored as a little-endian int16, swaps to big-endian at runtime on Mac) | ||
::Three 5-bit channels with bitmasks 0x001F (Red), 0x03E0 (Green) and 0x7C00 (Blue), 1-bit alpha (0x8000). | ::Three 5-bit channels with bitmasks 0x001F (Red), 0x03E0 (Green) and 0x7C00 (Blue), 1-bit alpha (0x8000). | ||
}} | }} | ||
{{OBDtr| 0x94 | link |FFC8FF| 00 00 00 00 | unused | link to a [[OBD:TXAN|TXAN]] file; used if this texture is animated }} | {{OBDtr| 0x94 | link |FFC8FF| 00 00 00 00 | unused | link to a [[OBD:TXAN|TXAN]] file; used if this texture is animated }} | ||
{{OBDtr| 0x98 | link |FFC800| 00 00 00 00 | unused | link to a TXMP file that contain the environment map }} | {{OBDtr| 0x98 | link |FFC800| 00 00 00 00 | unused | link to a TXMP file that contain the environment map }} | ||
{{OBDtr| 0x9C | offset |C800C8| 20 00 00 00 |00 00 00 20| | {{OBDtr| 0x9C | offset |C800C8| 20 00 00 00 |00 00 00 20| offset of pixel data in the raw file (Windows retail only) }} | ||
{{OBDtr| 0xA0 | offset |C87C64| 00 00 00 00 | unused | | {{OBDtr| 0xA0 | offset |C87C64| 00 00 00 00 | unused | offset of pixel data in the separate file (Windows demo and Mac only) }} | ||
{{OBDtr| 0xA4 | char[12] |B0C3D4| AD DE | dead | The layout of these 12 bytes is different for the | {{OBDtr| 0xA4 | char[12] |B0C3D4| AD DE | dead | The layout of these 12 bytes is different for the v1.0 and v1.1 versions (i.e. Windows retail vs. Windows demo and Mac): | ||
*For a | *For a v1.1 TXMP, the four bytes at 0xA4-A7 are "00 00 00 00" instead of "AD DE AD DE", and correspond to a "material type" attributed at runtime (from [[TMBD]]), which is then used for impact/breakability lookup. The Windows retail TXMPs apparently have no such "material type" field. | ||
*The fields at 0xA8-AF (for | *The fields at 0xA8-AF (for v1.1) or 0xA4-AB (for v1.0) are used only at runtime (and somehow obfuscated by "DEAD" when written to disk). Judging by the Windows demo and Mac engine, we can assume they are the same in both engines, and serve for rendering optimization (there is a texture name pointer, a "dirty" flag stored as a byte and 3 extra bytes used as flags). | ||
*For Windows retail, the four bytes at 0xAC-AF are completely unused (not part of the template). | *For Windows retail, the four bytes at 0xAC-AF are completely unused (not part of the template). | ||
Since runtime fields are grouped at the end, | Since runtime fields are grouped at the end, v1.0 and v1.1 TXMPs are treated by OniSplit under the same template, merely switching between the .raw and .sep links and blanking out everything past 0xA4. | ||
}} | }} | ||
{{OBDtr| 0xB0 | char[16] |B0C3D4| AD DE | dead | completely unused bytes (not part of the | {{OBDtr| 0xB0 | char[16] |B0C3D4| AD DE | dead | completely unused bytes (not part of the v1.0 or v1.1 TXMP template) }} | ||
|} | |} | ||
| Line 113: | Line 112: | ||
{{OBD_Table_Header}} | {{OBD_Table_Header}} | ||
|- ALIGN=CENTER VALIGN=TOP | |- ALIGN=CENTER VALIGN=TOP | ||
{{OBDtr| 0x90 | int32 |C8FFC8| 56 00 | {{OBDtr| 0x90 | int32 |C8FFC8| 56 00 00 00 | 86 | index of the 256-color palette used by this texture (starts at 0x15800 in level3_palette.pal) }} | ||
{{OBDtr| 0x94 | int32 |C8FFFF| 10 00 00 00 | 16 | palette pixel format #16 (32-bit RGB, with inactive alpha); the other recurrent format is #17 (32-bit RGBA) }} | {{OBDtr| 0x94 | int32 |C8FFFF| 10 00 00 00 | 16 | palette pixel format #16 (32-bit RGB, with inactive alpha); the other recurrent format is #17 (32-bit RGBA) }} | ||
{{OBDtr| 0x98 | link |FFC8FF| 00 00 00 00 | unused | link to a [[OBD:TXAN|TXAN]] file; used if this texture is animated }} | {{OBDtr| 0x98 | link |FFC8FF| 00 00 00 00 | unused | link to a [[OBD:TXAN|TXAN]] file; used if this texture is animated }} | ||
{{OBDtr| 0x9C | link |FFC800| 00 00 00 00 | unused | link to a TXMP file that contains the environment map }} | {{OBDtr| 0x9C | link |FFC800| 00 00 00 00 | unused | link to a TXMP file that contains the environment map }} | ||
{{OBDtr| 0xA0 | offset |C800C8| C0 05 00 00 |00 00 05 C0| | {{OBDtr| 0xA0 | offset |C800C8| C0 05 00 00 |00 00 05 C0| offset of the pixel data in the .raw file }} | ||
{{OBDtr| 0xA4 | offset |C87C64| 00 00 00 00 | unused | | {{OBDtr| 0xA4 | offset |C87C64| 00 00 00 00 | unused | offset of pixel data in the .sep file (unused) }} | ||
{{OBDtr| 0xA8 | int32 |B0C3D4| 00 00 00 00 | 0 | always 0; supposedly the same "material type" (set at runtime) as for Windows demo and Mac }} | {{OBDtr| 0xA8 | int32 |B0C3D4| 00 00 00 00 | 0 | always 0; supposedly the same "material type" (set at runtime) as for Windows demo and Mac }} | ||
{{OBDtr| 0xAC | char[4] |B0C3D4| AD DE AD DE | dead | supposedly the same texture name pointer (used at runtime) as for Windows demo and Mac }} | {{OBDtr| 0xAC | char[4] |B0C3D4| AD DE AD DE | dead | supposedly the same texture name pointer (used at runtime) as for Windows demo and Mac }} | ||
| Line 124: | Line 123: | ||
{{OBDtr| 0xB4 | char[12] |B0C3D4| AD DE | dead | completely unused bytes (not part of the template) }} | {{OBDtr| 0xB4 | char[12] |B0C3D4| AD DE | dead | completely unused bytes (not part of the template) }} | ||
|} | |} | ||
;Alternative use of .raw or .sep storage | ;Alternative use of .raw or .sep storage | ||
Unlike | Unlike the Win/Mac game data (where pixel data is stored exclusively in .raw or exclusively in .sep for all TXMPs), PS2 TXMPs use .raw and .sep storage alternatively, depending on the TXMP. The engine apparently uses the .sep pointer only if there is no .raw pointer (or vice versa). | ||
Examples of textures using .sep storage are: all [[:Category:Fly-in_portraits|fly-in portraits]]; all [[:Category:Splashscreens|splashscreen]] components; some illustrations in Konoko's | Examples of textures using .sep storage are: all [[:Category:Fly-in_portraits|fly-in portraits]]; all [[:Category:Splashscreens|splashscreen]] components; some illustrations in Konoko's [[Data Comlink]] (namely, [[:File:TXMPLevel02move.png|combat move illustrations]] and [[:File:TXMPhypo.png|item illustrations]]; objectives and weapon illustrations use .raw storage). | ||
Environment/character/particle TXMPs seem to be using .raw storage consistently (not checked beyond level1_Final). As a notable anomaly, .sep storage is used for the following three textures (console screens) in level0_Final: _CON_SAVEGAME (main TXMP only; the animation frames use .raw storage), _CON_SAVEGAME_USED, _CON_USED. | Environment/character/particle TXMPs seem to be using .raw storage consistently (not checked beyond level1_Final). As a notable anomaly, .sep storage is used for the following three textures (console screens) in level0_Final: _CON_SAVEGAME (main TXMP only; the animation frames use .raw storage), _CON_SAVEGAME_USED, _CON_USED. | ||
==Oni's internal storage types== | |||
Some of Oni's 16 types of image storage are elaborated on below in order to illustrate exactly how they work. The RAM view assumes little-endianness, which is true for Windows and for Macs since 2006. | |||
===ARGB4444 (type 0)=== | |||
*A 16-bit field is used to store 4 color channels (4 bits each, values from 0 to 15). | *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. | *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). | ||
{|border=1 cellpadding=3 cellspacing=0 | {|border=1 cellpadding=3 cellspacing=0 | ||
!<br | !<br>Bits | ||
!Byte 1 (high)<br | !Byte 1 (high)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 0 (low)<br | !Byte 0 (low)<br><code>7 6 5 4 3 2 1 0</code> | ||
|- | |- | ||
!Masks||<code>A A A A R R R R</code>||<code>G G G G B B B B</code> | !Masks||<code>A A A A R R R R</code>||<code>G G G G B B B B</code> | ||
|- | |- | ||
!colspan=3|<br | !colspan=3|<br>Bit values for primary colors (fully opaque) | ||
!Hex view | !Hex view | ||
! | !RAM view | ||
|- | |- | ||
|Black||<code>1 1 1 1 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | |Black||<code>1 1 1 1 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | ||
| Line 196: | Line 173: | ||
!FF F0!!F0 FF | !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). | *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. | *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. | *The high bit (0x8000) is unused, but is always set to 1 by convention. | ||
* | *Stored in little-endian order in TXMP. | ||
{|border=1 cellpadding=3 cellspacing=0 | {|border=1 cellpadding=3 cellspacing=0 | ||
!<br | !<br>Bits | ||
!Byte 1 (high)<br | !Byte 1 (high)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 0 (low)<br | !Byte 0 (low)<br><code>7 6 5 4 3 2 1 0</code> | ||
|- | |- | ||
!Masks||<code>X R R R R R G G</code>||<code>G G G B B B B B</code> | !Masks||<code>X R R R R R G G</code>||<code>G G G B B B B B</code> | ||
|- | |- | ||
!colspan=3|<br | !colspan=3|<br>Bit values for primary colors | ||
!Hex view | !Hex view | ||
! | !RAM view | ||
|- | |- | ||
|Black||<code>1 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | |Black||<code>1 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | ||
| Line 238: | Line 214: | ||
!FF E0!!E0 FF | !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. | *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. | *Bit masks are 0x001F for Blue, 0x03E0 for Green, 0x7C00 for Red, and 0x8000 for Alpha. | ||
{|border=1 cellpadding=3 cellspacing=0 | {|border=1 cellpadding=3 cellspacing=0 | ||
!<br | !<br>Bits | ||
!Byte 1 (high)<br | !Byte 1 (high)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 0 (low)<br | !Byte 0 (low)<br><code>7 6 5 4 3 2 1 0</code> | ||
|- | |- | ||
!Masks||<code>A R R R R R G G</code>||<code>G G G B B B B B</code> | !Masks||<code>A R R R R R G G</code>||<code>G G G B B B B B</code> | ||
|- | |- | ||
!colspan=3|<br | !colspan=3|<br>Bit values for primary colors (opaque) | ||
!Hex view | !Hex view | ||
! | !RAM view | ||
|- | |- | ||
|Black||<code>1 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | |Black||<code>1 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | ||
| Line 279: | Line 253: | ||
!FF E0!!E0 FF | !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). | *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. | *Bit masks are 0x0F for Intensity, 0xF0 for Alpha. | ||
| Line 306: | Line 280: | ||
|} | |} | ||
===ARGB8888 (type 7)=== | |||
*A 32-bit field is used to store 4 color channels (8 bits each, values from 0 to 255). | *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. | *Bit masks are 0x000000FF for Blue, 0x0000FF00 for Green, 0x00FF0000 for Red, 0xFF000000 for Alpha. | ||
{|border=1 cellpadding=3 cellspacing=0 | {|border=1 cellpadding=3 cellspacing=0 | ||
!<br | !<br>Bits | ||
!Byte 3 (highest)<br | !Byte 3 (highest)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 2 (higher)<br | !Byte 2 (higher)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 1 (high)<br | !Byte 1 (high)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 0 (low)<br | !Byte 0 (low)<br><code>7 6 5 4 3 2 1 0</code> | ||
|- | |- | ||
!Masks||<code>A A A A A A A A</code>||<code>R R R R R R R R</code>||<code>G G G G G G G G</code>||<code>B B B B B B B B</code> | !Masks||<code>A A A A A A A A</code>||<code>R R R R R R R R</code>||<code>G G G G G G G G</code>||<code>B B B B B B B B</code> | ||
|- | |- | ||
!colspan=5|<br | !colspan=5|<br>Bit values for primary colors (fully opaque) | ||
!Hex view | !Hex view | ||
! | !RAM view | ||
|- | |- | ||
|Black||<code>1 1 1 1 1 1 1 1</code>||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | |Black||<code>1 1 1 1 1 1 1 1</code>||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | ||
| Line 349: | Line 320: | ||
!FF FF FF 00!!00 FF FF FF | !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). | *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. | *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. | *The high byte (0xFF000000) is unused, but is always set to 00 by convention. | ||
{|border=1 cellpadding=3 cellspacing=0 | {|border=1 cellpadding=3 cellspacing=0 | ||
!<br | !<br>Bits | ||
!Byte 3 (highest)<br | !Byte 3 (highest)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 2 (higher)<br | !Byte 2 (higher)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 1 (high)<br | !Byte 1 (high)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 0 (low)<br | !Byte 0 (low)<br><code>7 6 5 4 3 2 1 0</code> | ||
|- | |- | ||
!Masks||<code>X X X X X X X X</code>||<code>R R R R R R R R</code>||<code>G G G G G G G G</code>||<code>B B B B B B B B</code> | !Masks||<code>X X X X X X X X</code>||<code>R R R R R R R R</code>||<code>G G G G G G G G</code>||<code>B B B B B B B B</code> | ||
|- | |- | ||
!colspan=5|<br | !colspan=5|<br>Bit values for primary colors | ||
!Hex view | !Hex view | ||
! | !RAM view | ||
|- | |- | ||
|Black||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | |Black||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code>||<code>0 0 0 0 0 0 0 0</code> | ||
| Line 393: | Line 362: | ||
!00 FF FF 00!!00 FF FF 00 | !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). | *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). | *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. | *Endianness is irrelevant when storing as a sequence of bytes. | ||
{|border=1 cellpadding=3 cellspacing=0 | {|border=1 cellpadding=3 cellspacing=0 | ||
!<br | !<br>Bits | ||
!Byte 0 (red)<br | !Byte 0 (red)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 1 (green)<br | !Byte 1 (green)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 2 (blue)<br | !Byte 2 (blue)<br><code>7 6 5 4 3 2 1 0</code> | ||
|- | |- | ||
!Masks||<code>R R R R R R R R</code>||<code>G G G G G G G G</code>||<code>B B B B B B B B</code> | !Masks||<code>R R R R R R R R</code>||<code>G G G G G G G G</code>||<code>B B B B B B B B</code> | ||
| Line 433: | Line 402: | ||
!FF FF 00 | !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). | *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. | *Each channel has its own byte. Endianness is irrelevant when storing as a sequence of bytes. | ||
{|border=1 cellpadding=3 cellspacing=0 | {|border=1 cellpadding=3 cellspacing=0 | ||
!<br | !<br>Bits | ||
!Byte 0 (red)<br | !Byte 0 (red)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 1 (green)<br | !Byte 1 (green)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 2 (blue)<br | !Byte 2 (blue)<br><code>7 6 5 4 3 2 1 0</code> | ||
!Byte 3 (alpha)<br | !Byte 3 (alpha)<br><code>7 6 5 4 3 2 1 0</code> | ||
|- | |- | ||
!Masks||<code>R R R R R R R R</code>||<code>G G G G G G G G</code>||<code>B B B B B B B B</code>||<code>A A A A A A A A</code> | !Masks||<code>R R R R R R R R</code>||<code>G G G G G G G G</code>||<code>B B B B B B B B</code>||<code>A A A A A A A A</code> | ||
|- | |- | ||
!colspan=5|<br | !colspan=5|<br>Bit values for primary colors (fully opaque) | ||
!Hex view | !Hex view | ||
|- | |- | ||
| Line 473: | Line 442: | ||
!FF FF 00 FF | !FF FF 00 FF | ||
|} | |} | ||
==Notes== | ==Notes== | ||
<references/> | <references/> | ||
{{OBD_File_Footer | type=TXMP | prev=TXMB | next=TxtC | name=Texture Map | family= | {{OBD_File_Footer | type=TXMP | prev=TXMB | next=TxtC | name=Texture Map | family=General}} | ||
{{OBD}} | {{OBD}} | ||