OBD:TXMP: Difference between revisions

From OniGalore
Jump to navigation Jump to search
No edit summary
(seems like we should note that ARGB8888 was inserted as a new format)
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Main Page]] >> [[OBD:Oni Binary Data|Oni Binary Data]] >> [[OBD:File types|File Types]] >> TXMP File
{{OBD_File_Header | type=TXMP | prev=TXMB | next=TxtC | name=Texture Map | family=Generic | align=center}}




<CENTER>[[OBD:TXMB|<==]] <FONT SIZE=5>TXMP File</FONT> [[OBD:TxtC|==>]]<BR>
[[image:txmp_all.gif]]
<FONT SIZE=2>Texture Map - Level, Character and Message File</FONT></CENTER>




http://www6.fh-eberswalde.de/user/dkriesch/onistuff/images/txmp_all.gif
{{Table}}
{{OBD_Table_Header}}
|- ALIGN=CENTER VALIGN=TOP
{{OBDtr| 0x00 | res_id  |FF0000| 01 1F 00 00 | 31        | 00031-rl_1.TXMP }}
{{OBDtr| 0x04 | lev_id  |FFFF00| 01 00 00 06 | 3        | level 3 }}
{{OBDtr2|0x08 | char[128]|FFC8C8| rl_1                    | name of the texture; unused }}
{{OBDtr| 0x88 | int32    |FFFFC8| 00 10 00 00 | 0x1000    | options; possible option flags (from left to right):
:0x'''01''' 00 00 00 - has mipmaps
:0x'''04''' 00 00 00 - U wrapping disabled
:0x'''08''' 00 00 00 - V wrapping disabled
:0x'''10''' 00 00 00 - ignored
:0x'''40''' 00 00 00 - animation order: play back to back (frames 0 to n then n-1 to 0)
:0x'''80''' 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) }}
{{OBDtr| 0x8C | int16    |C8FFC8| 80 00      | 128      | width 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 RGB555; used texture formats:
:0 - ARGB4444, 16 bits/pixel, 4 bits per channel, alpha channel present (GL_RGBA4 OpenGL texture format)
:1 - RGB555, 16 bits/pixel, 5 bits per channel, no alpha channel (GL_RGB5 OpenGL texture format)
:2 - ARGB5551, 16 bits/pixel, 5 bits per color channel, 1 bit alpha channel (GL_RGB5_A1 OpenGL texture format)
:(7 - ARGB8888, 32 bits/pixel with alpha channel; this is an additional format inserted into Oni by the Daodan DLL in Windows and by the Feral Intel build on Macs, for use with mods)
:8 - RGB888, 32 bits/pixel, 8 bits per color channel, no alpha channel (GL_RGB OpenGL texture format)
:9 - S3TC/DXT1, compressed 4 times (GL_COMPRESSED_RGB_S3TC_DXT1_EXT OpenGL texture format) }}
{{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| 0x9C | offset  |C800C8| 20 00 00 00 |00 00 00 20| at this position starts the texture part in the raw file (Windows only) }}
{{OBDtr| 0xA0 | offset  |C87C64| 00 00 00 00 | unused    | at this position starts the texture part in the separate file (Mac retail/demo and Windows demo only) }}
{{OBDtr| 0xA4 | char[28] |B0C3D4| AD DE      | dead      | unused }}
|}




{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
;Effect options
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
:"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.
| WIDTH=15% | <B>Hex</B>
| WIDTH=15% | <B>Translation</B>
| WIDTH=70% | <B>Meaning</B>
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FF0000" | 01 1F 00 00
| 31
| ALIGN=LEFT | 00031-rl_1.TXMP
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFFF00" | 01 00 00 06
| 3
| ALIGN=LEFT | level 3
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#00FF00" COLSPAN=2 | <TT>rl_1</TT>
| ALIGN=LEFT | name of the texture
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#00FFFF" | 00
| 0
| ALIGN=LEFT | MIP-mapping option; the following options are possible:<P>00 - off<BR>01 - on


|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
;Animation time
| BGCOLOR="#FF00FF" | 10
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.
| 16
| ALIGN=LEFT | color depth (= 16 bit)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC8C8" | 00 00
| 0
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFFFC8" | 80 00
| 128
| ALIGN=LEFT | width (= 128 pixel)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFFFC8" | 80 00
| 128
| ALIGN=LEFT | height (= 128 pixel)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFC8" | 01 00 00 00
| 1
| ALIGN=LEFT | store type = 1 (uncompressed, without alpha)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | 00 00 00 00
| not used
| ALIGN=LEFT | link to a [[OBD:TXAN|TXAN]] file; only used if the texture is the first pic of an texture animation
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC8FF" | 00 00 00 00
| not used
| ALIGN=LEFT | link to a TXMP file; only used in connection with shade vertex effects (cel shading)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC800" | 20 00 00 00
| 32
| ALIGN=LEFT | at this position starts the texture part in the raw file
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C800C8" | 00 00 00 00
| 0
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C87C64" | AD DE
| dead
| ALIGN=LEFT | not used
|}


;Pixel storage order
:Below you can see the pictures for this example. The first picture shows how it's stored in Oni, the second how you see it in the game.


{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
{|border=0
|- BGCOLOR="#FFDDBB"
|+Pixel arrangement
| WIDTH=15% | <B>Option</B>
!how it's stored
| WIDTH=15% | <B>Value</B>
!&nbsp;
| WIDTH=70% | <B>Meaning</B>
!how you'll see it
|- VALIGN=TOP BGCOLOR="#FFEEDD"
|-
| ROWSPAN=4 | MIP-mapping types
|[[Image:txmp_ex1.gif]]
| BGCOLOR="#00FFFF" | 00
|&nbsp;
| off
|[[Image:txmp_ex2.gif]]
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#00FFFF" | 01
| on
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#00FFFF" | 11
| unknown
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#00FFFF" | 1C
| unknown (skybox use it, works with 00 too)
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| ROWSPAN=4 | Color depths
| BGCOLOR="#FF00FF" | 10
| 16 bit
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FF00FF" | 12
| 16 bit + shade vertex
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FF00FF" | 14
| 16 bit + transparency to the background color, if it's black
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FF00FF" | 20
| 32 bit
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| ROWSPAN=8 | Store types
| BGCOLOR="#C8FFFF" | 00
| uncopmressed, with alpha
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | 01
| uncopmressed, without alpha
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | 02
| unknown
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | 03
| unknown
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | 08
| 32 bit uncompressed (skybox use it)
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | 09
| compressed
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | 0A
| unknown
|- VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | 0B
| unknown
|}
|}




Below you can see the pictures for this example. The first picture shows how its stored in Oni, the second how you'll see it in the game.
{{OBD_File_Footer | type=TXMP | prev=TXMB | next=TxtC | name=Texture Map | family=Generic}}
 
 
http://www6.fh-eberswalde.de/user/dkriesch/onistuff/images/txmp_ex1.gif &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www6.fh-eberswalde.de/user/dkriesch/onistuff/images/txmp_ex2.gif
 
 
<HR>
<CENTER>[[OBD:TXMB|<==]] <B>TXMP File</B> [[OBD:TxtC|==>]]</CENTER>
<HR>
 


[[Main Page]] >> [[OBD:Oni Binary Data|Oni Binary Data]] >> [[OBD:File types|File Types]] >> TXMP File
{{OBD}}

Revision as of 14:34, 25 March 2016

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 RGB555; used texture formats:
0 - ARGB4444, 16 bits/pixel, 4 bits per channel, alpha channel present (GL_RGBA4 OpenGL texture format)
1 - RGB555, 16 bits/pixel, 5 bits per channel, no alpha channel (GL_RGB5 OpenGL texture format)
2 - ARGB5551, 16 bits/pixel, 5 bits per color channel, 1 bit alpha channel (GL_RGB5_A1 OpenGL texture format)
(7 - ARGB8888, 32 bits/pixel with alpha channel; this is an additional format inserted into Oni by the Daodan DLL in Windows and by the Feral Intel build on Macs, for use with mods)
8 - RGB888, 32 bits/pixel, 8 bits per color channel, no alpha channel (GL_RGB OpenGL texture format)
9 - S3TC/DXT1, compressed 4 times (GL_COMPRESSED_RGB_S3TC_DXT1_EXT OpenGL texture format)
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
Below you can see the pictures for this example. The first picture shows how it's stored in Oni, the second how you see it in the game.
Pixel arrangement
how it's stored   how you'll see it
Txmp ex1.gif   Txmp ex2.gif


ONI BINARY DATA
TXMB << Other file types >> TxtC
TXMP : Texture Map
Generic file