OBD:TXMP

From OniGalore
Revision as of 01:28, 9 July 2021 by Geyser (talk | contribs) (first brain dump of many; hopefully useful)
Jump to navigation Jump to search
ONI BINARY DATA
TXMB << Other file types >> TxtC
TXMP : Texture Map
switch to XML:TXMP page
Overview @ Oni Stuff
OBD.png


Txmp all.gif


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):
0x01 00 00 00 - has mipmaps
0x04 00 00 00 - U wrapping disabled
0x08 00 00 00 - V wrapping disabled
0x10 00 00 00 - ignored
0x40 00 00 00 - animation order: play back to back (frames 0 to n then n-1 to 0)
0x80 00 00 00 - animation order: play in random order
0x00 01 00 00 - animation time: add local (particle) time (see below)
0x00 02 00 00 - has environment map texture
0x00 04 00 00 - additive alpha blending
0x00 10 00 00 - little endian data
0x00 40 00 00 - animation time: ignore game time (see below)
0x00 80 00 00 - effect: shield (blue)
0x00 00 01 00 - effect: invisibility
0x00 00 02 00 - effect: daodan shield (red)
0x8C int16 80 00 128 width of the image in pixels
0x8E int16 80 00 128 height of the image in pixels
0x90 int32 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-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).
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).
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-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).
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 Vanilla TXMPs) - I1, 8 pixels/byte. Pixel rows, bottom to top. Monochrome "intensity" (black-or-white).
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 Vanilla TXMPs) - A4I4, 8 bits/pixel, stored as a single byte. Intensity (bit mask 0x0F), alpha (0xF0).
7 (never used in Vanilla TXMPs[1]) - ARGB8888, 32 bits/pixel (stored as a little-Endian int32, swaps to big Endian at runtime on Mac)
Four 8-bit channels, with bitmasks 0x000000FF (Blue), 0x0000FF00 (Green), 0x00FF0000 (Red) and 0xFF000000 (Alpha).
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).
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 (GL_COMPRESSED_RGB_S3TC_DXT1_EXT OpenGL texture format)
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.
11 (never used in Vanilla TXMPs[2]) - RGBA_Bytes, 32 bits/pixel, stored as 4 consecutive bytes: first Red, then Green, then Blue, then Alpha.
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).
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).
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).
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).
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 at this position starts the texture part in the raw file (Windows only)
0xA0 offset 00 00 00 00 unused at this position starts the texture part in the separate file (Mac retail/demo and Windows demo only)
0xA4 char[28] AD DE dead unused


Effect options
"Shield", "Invisibility" and "Daodan shield" options do not affect the texture reading/drawing in any way. The texture data is still RGB555 or whatever format the texture format field says it is. The effect of these flags is that the engine uses vertex shading with a colour that varies with time.
Animation time

When using animated textures the image to display is selected using the game time and animation speed. For textures that are used by particles the local (particle) time can be used either to replace or offset the game time.

Pixel storage order
Pixels are stored in row-major order, meaning that all the pixels forming a scanline (image row) are grouped together (stored in left-to right order); the rows are stored in bottom-to-top order (see illustration below).
In the case of the DXT1 storage format, the row-major, left-to-right, bottom-to-top 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 (several pixels per byte), the row-major, left-to-right, bottom-to-top order applies to the 1-bit pixels composing the image.
Pixel arrangement
how it's stored   how you'll see it
Txmp ex1.gif   Txmp ex2.gif

Notes

  1. 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.
  2. 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 PC and Mac versions of TXMPs.
ONI BINARY DATA
TXMB << Other file types >> TxtC
TXMP : Texture Map
Generic file