XML:TXMP: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(adding an image demonstrating problematic transparency effects)
m (marking dead links)
(12 intermediate revisions by 3 users not shown)
Line 3: Line 3:
===general notes===
===general notes===
* The xml code on this page was tested with onisplit '''v0.9.61.0'''
* The xml code 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 (pixel) dimension must be power of two: 512, 256, 128, 64, etc. (The TXMP used to compose the [[XML:TXMB|TXMB]] files seem to be an exception).
** Hight and width don't need to be equal, e.g. you can use 128x256.
** Hight 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.


===TXMP subtypes===
===TXMP subtypes===
Line 66: Line 66:
|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|Caution with transparent textures.]]
[[Image:problems_with_AdditiveBlend_and_regular_transparency.jpg|thumb|200px|right|Caution with transparent textures.]]


Line 77: Line 76:
: AnimUseLocalTime (to export an animated texture convert the oni file to xml)
: AnimUseLocalTime (to export an animated texture convert the oni file to xml)
<!-- HasEnvMap (used via tag, not flag) -->
<!-- HasEnvMap (used via tag, not flag) -->
: AdditiveBlend (makes black texture parts transparent in-game)
: 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 don't becomes exported) -->
<!-- SwapBytes (automatically added in v0.9.56.0 and above, flag doesn't become 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>
Line 90: Line 89:
| '''A'''RGB formats are used for reflective textures. (A - Alpha; R - Red; G - Green; B - Blue)
| '''A'''RGB formats are used for reflective textures. (A - Alpha; R - Red; G - Green; B - Blue)


ARGB8888 can be used only if you use an updated engine (which comes with AE). (Mac users also need to [http://oni.bungie.org/community/forum/viewtopic.php?pid=29967#p29967 swap the color channels.])
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/forum/viewtopic.php?pid=29967#p29967 swap the color channels] of a texture or else it will appear inverted.)


{|class="wikitable" width="100%"
{|class="wikitable" width="100%"
Line 130: Line 129:
|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 xml file is meant to create an animated texture. In that case you use multiple <Image> tags.
Let's say Speed is set to 7, then every 7th frame will change the image.
|-
|-
|valign=top| <EnvMap>
|valign=top| <EnvMap>
Line 139: Line 140:
|valign=top| <Image>
|valign=top| <Image>
|valign=top| link
|valign=top| link
| Choose between tga/png/dds.
|
: TXMP''name''.tga


: TXMP''name''.tga
JGP, PNG and DDS are only supported by creation via commandline with -create:txmp
: TXMP''name''.png
: TXMP''name''.dds
|}
|}
===Animated textures===
[[Image:Animated_level_texture_with_and_without_AdditiveBlend.jpg|200px|thumb|Animated billboard]]
[[Image:Animated_level_texture.gif|200px|thumb|Animated billboard GIF]]
It requires some tiresome handwork to write an XML file with a large number of <Image> tags.
Skip that work (<nowiki>https://dl.dropboxusercontent.com/u/139715/OniGalore/Simple_OniSplit_GUI_TXMP_animated.png</nowiki>, dead link) by using [http://paradox.oni2.net/programs/Simple_OniSplit_GUI.zip Simple OniSplit GUI.] (Normal TXMP creation (<nowiki>https://dl.dropboxusercontent.com/u/139715/OniGalore/Simple_OniSplit_GUI_TXMP.png</nowiki>, dead link) is also supported.)
Notes of warning:
# With XML, OniSplit can only import TGA files.
# AdditiveBlend should only be used on things that are supposed to glow otherwise you might think that it ignores vertex shading. In case of the billboard at the right, that was an improvement. Now it's a transparent OLED billboard.
# Long animations in high quality (512x512, RGB) will produce very big oni files. The not-edited billboard gif is 1.7MB, the oni file is 273MB. That's because TXAN can use high quality and stores also all repetitive frames. The compressed oni (zip) was still 66MB which is still unreasonable large for people with small internet bandwidth. The billboard could possibly broken up into the 3 static and 3 transitional images. You would then need a [[XML:ONLV#Texture_exchange|BSL loop]] to keep the animation going. So the conclusion is to use animated images with lower quality settings and avoid repetitive elements.
[[Creating_image_animations|HERE]] are a few information on how to create an animated texture within a graphics program.


{{XML}}
{{XML}}

Revision as of 13:51, 21 August 2020

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 code 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. (The TXMP used to compose the TXMB files seem to be an exception).
    • Hight 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.

TXMP subtypes

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 tag content type description
<?xml version="1.0" encoding="utf-8"?> float, flag Don't change this.
<Oni> -
<Texture> -
<Flags> flag
Caution with transparent textures.
None
HasMipMaps
DisableUWrap
DisableVWrap
Unknown0010
AnimUseLocalTime (to export an animated texture convert the oni file to xml)
AdditiveBlend (makes black texture parts transparent in-game, usually set for animated textures)
AnimBackToBack
AnimRandom
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. (A - Alpha; R - Red; G - Green; B - 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 swap the color channels of a texture or else it will appear inverted.)

XML flags command line flags
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 xml file is meant to create an animated texture. In that case you use multiple <Image> tags.

Let's say Speed is set to 7, then every 7th frame will change the image.

<EnvMap> link TXMPname (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.

<Image> link
TXMPname.tga

JGP, PNG and DDS are only supported by creation via commandline with -create:txmp


Animated textures

Animated billboard
Animated billboard GIF

It requires some tiresome handwork to write an XML file with a large number of <Image> tags.

Skip that work (https://dl.dropboxusercontent.com/u/139715/OniGalore/Simple_OniSplit_GUI_TXMP_animated.png, dead link) by using Simple OniSplit GUI. (Normal TXMP creation (https://dl.dropboxusercontent.com/u/139715/OniGalore/Simple_OniSplit_GUI_TXMP.png, dead link) is also supported.)

Notes of warning:

  1. With XML, OniSplit can only import TGA files.
  2. AdditiveBlend should only be used on things that are supposed to glow otherwise you might think that it ignores vertex shading. In case of the billboard at the right, that was an improvement. Now it's a transparent OLED billboard.
  3. Long animations in high quality (512x512, RGB) will produce very big oni files. The not-edited billboard gif is 1.7MB, the oni file is 273MB. That's because TXAN can use high quality and stores also all repetitive frames. The compressed oni (zip) was still 66MB which is still unreasonable large for people with small internet bandwidth. The billboard could possibly broken up into the 3 static and 3 transitional images. You would then need a BSL loop to keep the animation going. So the conclusion is to use animated images with lower quality settings and avoid repetitive elements.

HERE are a few information on how to create an animated texture within a graphics program.