XML:TXMP: Difference between revisions

From OniGalore
Jump to navigation Jump to search
mNo edit summary
m (breaking section into two sections)
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{XML_File_Header | type=TXMP | prev=TXMB | next=TxtC | name=Texture Map }}
{{XML_File_Header | prev=TXMB | type=TXMP | next=TxtC | name=Texture Map}}


===general notes===
==General notes==
* The xml code on this page was tested with onisplit '''v0.9.61.0'''
* The XML on this page was tested with OniSplit '''v0.9.61.0'''.
* Textures' x and y (pixel) dimension must be power of two: 512, 256, 128, 64, etc.
* Textures' X and Y dimensions must be powers of two: 512, 256, 128, 64, etc. (The TXMPs used to compose [[XML:TXMB|TXMBs]] seem to be an exception.)
** Hight and width don't need to be equal, e.g. you can use 128x256.
** However the height and width don't need to be equal, e.g. you can use 128x256.
* The camera can look at 2049 transparent textures at once, one more and Oni crashes.
* The camera can look at 2049 transparent textures at once; one more, and Oni crashes.


 
==Tag hierarchy==
===TXMP subtypes===
{|class="wikitable" width="100%"
{|class="wikitable" width="100%"
! standard texture
! Standard texture
! animated texture
! Animated texture
! reflective texture
! Reflective texture
|-
|-
|valign=top|
|valign=top|
Line 46: Line 45:
|}
|}


 
==XML tags==
 
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|valign=top| <?xml version="1.0" encoding="utf-8"?>
|valign=top| float, flag
|valign=top| Don't change this.
|-
|valign=top| <Oni>
|valign=top| -
|
|-
|-
|valign=top| <Texture>
|valign=top| <Texture>
Line 67: Line 57:
|valign=top| <Flags>
|valign=top| <Flags>
|valign=top| flag
|valign=top| flag
| ShieldEffect, InvisibilityEffect and DaodanEffect are special flags, they can only be used for TXMPshield, TXMPinvis and TXMPDAODAN_SHIELD. The usage of these textures is hardcoded.
|  
 
[[Image:problems_with_AdditiveBlend_and_regular_transparency.jpg|thumb|200px|right|Be careful with transparent textures.]]
[[Image:problems_with_AdditiveBlend_and_regular_transparency.jpg|thumb|200px|right|Caution with transparent textures.]]


: None
: None
Line 76: Line 65:
: DisableVWrap
: DisableVWrap
: Unknown0010
: Unknown0010
: AnimUseLocalTime (to export an animated texture convert the oni file to xml)
: AnimUseLocalTime (to export an animated texture, extract the .oni file as XML)
<!-- HasEnvMap (used via tag, not flag) -->
: HasEnvMap (don't use directly; used via tag)
: AdditiveBlend (makes black texture parts transparent in-game, usually set for animated textures)
: AdditiveBlend (makes black texture parts transparent in-game, usually set for animated textures)
: AnimBackToBack
: AnimBackToBack
: AnimRandom
: AnimRandom
<!-- SwapBytes (automatically added in v0.9.56.0 and above, flag doesn't become exported) -->
: SwapBytes (defunct; this is automatically added in v0.9.56.0 and above, so you won't see the flag in an exported)
: AnimIgnoreGlobalTime
: AnimIgnoreGlobalTime
: ShieldEffect
: ShieldEffect (hardcoded usage, reserved for TXMPshield)
: InvisibilityEffect
: InvisibilityEffect (hardcoded usage, reserved for TXMPinvis)
: DaodanEffect
: DaodanEffect (hardcoded usage, reserved for TXMPDAODAN_SHIELD)
|-
|-
|valign=top| <Format>
|valign=top| <Format>
|valign=top| flag
|valign=top| flag
| '''A'''RGB formats are used for reflective textures. (A - Alpha; R - Red; G - Green; B - Blue)
| '''A'''RGB formats are used for reflective textures (Alpha Red Green Blue)


ARGB8888 can be used only if you use an updated engine (which comes with AE). (Oni running on a modern Intel Mac uses the same texture format as Windows Oni, but users of older PowerPC Macs will need to [http://oni.bungie.org/community/forum/viewtopic.php?pid=29967#p29967 swap the color channels] of a texture or else it will appear inverted.)
ARGB8888 can be used only if you use an updated engine (which comes with the AE). (When Macs were still on the PowerPC processor, Oni's textures needed to have [http://oni.bungie.org/forum/viewtopic.php?pid=29967#p29967 their color channels swapped] or else they would appear color-inverted, but after the move to Intel Macs, both platforms used the same Windows-format textures.)


{|class="wikitable" width="100%"
{|class="wikitable" width="100%"
!colspan=2|XML flags
!colspan=2|XML flags
!colspan=2|<font color="#999999">command line flags</font>
!colspan=2|<font color="#999999">Options for command line argument "-format:"</font>
|-
|-
|up to onisplit v0.9.52.0
|Up to OniSplit v0.9.52.0
|for higher versions
|For higher versions
|<font color="#999999">up to onisplit v0.9.52.0</font>
|<font color="#999999">Up to OniSplit v0.9.52.0</font>
|<font color="#999999">for higher versions</font>
|<font color="#999999">For higher versions</font>
|-
|-
|width=25%|RGB888
|width=25%|RGB888
Line 130: Line 119:
|valign=top| <Speed>
|valign=top| <Speed>
|valign=top| integer
|valign=top| integer
| This tag is used if xml file is meant to create an animated texture. In that case you use multiple <Image> tags.
| This tag is used if the XML file is meant to create an animated texture. In that case you would use multiple <Image> tags.
 
Let's say Speed is set to 7 — then the animation will advance every 7th frame.
|-
|-
|valign=top| <EnvMap>
|valign=top| <EnvMap>
Line 136: Line 127:
| TXMP''name'' (file suffix .oni/.xml not allowed)
| TXMP''name'' (file suffix .oni/.xml not allowed)


This tag is used if xml file is meant to create an reflective texture. File suffixes like .tga or .oni is not used in the EnvMap link.
This tag is used if the XML file is meant to create a reflective texture. File suffixes like .tga or .oni are not used in the EnvMap link.
|-
|-
|valign=top| <Image>
|valign=top| <Image>
|valign=top| link
|valign=top| link
| Choose between tga/png/dds.
|
: TXMP''name''.tga


: TXMP''name''.tga
Creating a texture from a JPEG, PNG or DDS is only supported via the command line's "-create:txmp" argument.
: TXMP''name''.png
: TXMP''name''.dds
|}
|}
==Animated textures==
[[Image:Animated_level_texture_with_and_without_AdditiveBlend.jpg|200px|thumb|A sample animated billboard.]]
[[Image:Animated_level_texture.gif|200px|thumb|Original animated texture.]]
It's tiresome to manually create an XML file with a large number of <Image> tags. Skip that work by using [http://paradox.oni2.net/programs/Simple_OniSplit_GUI.zip Simple OniSplit GUI]. (Normal TXMP creation is also supported.)
Some advice:
# When using XML to import, OniSplit can only accept TGA images.
# AdditiveBlend should only be used on things that are supposed to glow — otherwise you might think that the object ignores its vertex shading. In the case of the billboard at the right, this was an improvement; now it's a transparent OLED billboard.
# Long animations in high quality (512x512, RGB) produce VERY big .oni files. The source billboard GIF is 1.7MB and the resulting .oni file is 273MB. That's because TXAN doesn't support variable timing like the GIF format, so a smooth animation like this one will have a ton of duplicate frames in it. Even as a ZIP, the .oni file was still 66MB, which is unreasonably large. The billboard could possibly be broken into 3 static and 3 transitional images, and then animated "manually" via a [[XML:ONLV#Texture_exchange|BSL loop]]. The conclusion is to use animated images with lower quality settings and to avoid long periods of duplicate frames which waste space.
[[Creating animated images|HERE]] is some information on how to create an animated texture within various graphics programs.


{{XML}}
{{XML}}

Revision as of 13:06, 5 April 2021

TXMP : Texture Map
XML modding tips
  • See HERE to start learning about XML modding.
  • See HERE if you are searching for information on how to handle object coordinates.
  • See HERE for some typical modding errors and their causes.
XML.png
XML

TXMB << Other file types >> TxtC

switch to OBD page

General notes

  • The XML on this page was tested with OniSplit v0.9.61.0.
  • Textures' X and Y dimensions must be powers of two: 512, 256, 128, 64, etc. (The TXMPs used to compose TXMBs seem to be an exception.)
    • However the height and width don't need to be equal, e.g. you can use 128x256.
  • The camera can look at 2049 transparent textures at once; one more, and Oni crashes.

Tag hierarchy

Standard texture Animated texture Reflective texture
<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <Texture>
       <Flags>...</Flags>
       <Format>...</Format>
       <Image>...</Image>
   </Texture>
</Oni>
<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <Texture>
       <Flags>...</Flags>
       <Format>...</Format>
       <Speed>...</Speed>
       <Image>...</Image>
       <Image>...</Image>
   </Texture>
</Oni>
<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <Texture>
       <Flags>...</Flags>
       <Format>...</Format>
       <EnvMap>...</EnvMap>
       <Image>...</Image>
   </Texture>
</Oni>

XML tags

XML tag Content type Description
<Texture> -
<Flags> flag
Be careful with transparent textures.
None
HasMipMaps
DisableUWrap
DisableVWrap
Unknown0010
AnimUseLocalTime (to export an animated texture, extract the .oni file as XML)
HasEnvMap (don't use directly; used via tag)
AdditiveBlend (makes black texture parts transparent in-game, usually set for animated textures)
AnimBackToBack
AnimRandom
SwapBytes (defunct; this is automatically added in v0.9.56.0 and above, so you won't see the flag in an exported)
AnimIgnoreGlobalTime
ShieldEffect (hardcoded usage, reserved for TXMPshield)
InvisibilityEffect (hardcoded usage, reserved for TXMPinvis)
DaodanEffect (hardcoded usage, reserved for TXMPDAODAN_SHIELD)
<Format> flag ARGB formats are used for reflective textures (Alpha Red Green Blue)

ARGB8888 can be used only if you use an updated engine (which comes with the AE). (When Macs were still on the PowerPC processor, Oni's textures needed to have their color channels swapped or else they would appear color-inverted, but after the move to Intel Macs, both platforms used the same Windows-format textures.)

XML flags Options for command line argument "-format:"
Up to OniSplit v0.9.52.0 For higher versions Up to OniSplit v0.9.52.0 For higher versions
RGB888 BGR bgr32 bgr
ARGB8888 RGBA bgra32 rgba
RGB555 BGR555 bgr555
ARGB5551 BGRA5551 bgra5551
ARGB4444 BGRA4444 bgra4444
DXT1 dxt1
<Speed> integer This tag is used if the XML file is meant to create an animated texture. In that case you would use multiple <Image> tags.

Let's say Speed is set to 7 — then the animation will advance every 7th frame.

<EnvMap> link TXMPname (file suffix .oni/.xml not allowed)

This tag is used if the XML file is meant to create a reflective texture. File suffixes like .tga or .oni are not used in the EnvMap link.

<Image> link
TXMPname.tga

Creating a texture from a JPEG, PNG or DDS is only supported via the command line's "-create:txmp" argument.

Animated textures

A sample animated billboard.
Original animated texture.

It's tiresome to manually create an XML file with a large number of <Image> tags. Skip that work by using Simple OniSplit GUI. (Normal TXMP creation is also supported.)

Some advice:

  1. When using XML to import, OniSplit can only accept TGA images.
  2. AdditiveBlend should only be used on things that are supposed to glow — otherwise you might think that the object ignores its vertex shading. In the case of the billboard at the right, this was an improvement; now it's a transparent OLED billboard.
  3. Long animations in high quality (512x512, RGB) produce VERY big .oni files. The source billboard GIF is 1.7MB and the resulting .oni file is 273MB. That's because TXAN doesn't support variable timing like the GIF format, so a smooth animation like this one will have a ton of duplicate frames in it. Even as a ZIP, the .oni file was still 66MB, which is unreasonably large. The billboard could possibly be broken into 3 static and 3 transitional images, and then animated "manually" via a BSL loop. The conclusion is to use animated images with lower quality settings and to avoid long periods of duplicate frames which waste space.

HERE is some information on how to create an animated texture within various graphics programs.