Template:Archived page history/Xwad/en: Difference between revisions
SirYodaJedi (talk | contribs) mNo edit summary |
SirYodaJedi (talk | contribs) m (→Options) |
||
Line 15: | Line 15: | ||
=== Required === | === Required === | ||
; {{code|-basedir <path>}} | ; {{code|-basedir <path>}} | ||
Location of [[gameinfo.txt]]. | : Location of [[gameinfo.txt]]. | ||
If xwad is called from the {{path|materialsrc}} directory, then {{code|..}} will suffice. | : If xwad is called from the {{path|materialsrc}} directory, then {{code|..}} will suffice. | ||
; {{code|-wadfile <file>.wad}} | ; {{code|-wadfile <file>.wad}} | ||
Line 25: | Line 25: | ||
=== Optional === | === Optional === | ||
; {{code|-transparent}} | ; {{code|-transparent}} | ||
Flag input [[BMP]] files as having alphatest transparency. For [[WAD]] files, this happens automatically for {{code|{}}-prefixed textures, and for [[SPR]] file, this happens automatically if the sprite has its transparency mode set to alphatest. | : Flag input [[BMP]] files as having alphatest transparency. For [[WAD]] files, this happens automatically for {{code|{}}-prefixed textures, and for [[SPR]] file, this happens automatically if the sprite has its transparency mode set to alphatest. | ||
A texture flagged as transparent will have [[texel]]s using [[palette]] index 255 (the last color) [[$translucent#Filtering_Borders|dilated]] based upon surrounding opaque texels, and {{ent|$alphatest|1}} added to the [[VMT]]. | : A texture flagged as transparent will have [[texel]]s using [[palette]] index 255 (the last color) [[$translucent#Filtering_Borders|dilated]] based upon surrounding opaque texels, and {{ent|$alphatest|1}} added to the [[VMT]]. | ||
Palette index 255 is always transparent in the output [[TGA]], but the underlying texels' colors are kept unless the texture is flagged as transparent. | : Palette index 255 is always transparent in the output [[TGA]], but the underlying texels' colors are kept unless the texture is flagged as transparent. | ||
; {{code|-decal}} | ; {{code|-decal}} | ||
'''Do not use'''. Creates VMTs using {{ent|DecalModulate}} shader and {{ent|$alphatest}} parameter. | : '''Do not use'''. Creates VMTs using {{ent|DecalModulate}} shader and {{ent|$alphatest}} parameter. | ||
: As this is not faithful to how GoldSrc decals work, {{wadmaker|4.1}} should be used to convert the decals instead (if necessary, using an [[image editor]] to pad all edges to the next power of two), and the VMTs created manually as {{ent|LightmappedGeneric}} with {{ent|$translucent|1}}, {{ent|$decal|1}}, and {{ent|$decalscale|1}}. | |||
As this is not faithful to how GoldSrc decals work, {{wadmaker|4.1}} should be used to convert the decals instead (if necessary, using an [[image editor]] to pad all edges to the next power of two), and the VMTs created manually as {{ent|LightmappedGeneric}} with {{ent|$translucent|1}}, {{ent|$decal|1}}, and {{ent|$decalscale|1}}. | |||
== Readme == | == Readme == |
Revision as of 16:25, 15 February 2024

A copy of this command-line tool can be found in following folder: common\SourceSDK\bin\<branchname>\bin\xwad.exe
. This tool can convert WAD, BMP, and SPR files to TGA and accompanied VMT files, as well as call vtex to generate associated VTF files.
After running XWAD and converting the textures to VTF, use the Convert WAD to VMT... button in Hammer 4.x's File menu (not in
) to automatically add material paths and fix the scaling of previously non-power-of-two textures.
Caveats




Syntax
Options

As a courtesy, please do not edit this Template while this message is displayed.
If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page.
The person who added this notice will be listed in its edit history should you wish to contact them.
Required
- -basedir <path>
- Location of gameinfo.txt.
- If xwad is called from the
materialsrc
directory, then .. will suffice.
- -wadfile <file>.wad
- -bmpfile <file>.bmp
- -sprfile <file>.spr
Convert a WAD, BMP, or SPR, respectively. Accepts preceding file paths and wildcards.
Optional
- -transparent
- Flag input BMP files as having alphatest transparency. For WAD files, this happens automatically for {-prefixed textures, and for SPR file, this happens automatically if the sprite has its transparency mode set to alphatest.
- A texture flagged as transparent will have texels using palette index 255 (the last color) dilated based upon surrounding opaque texels, and $alphatest 1 added to the VMT.
- Palette index 255 is always transparent in the output TGA, but the underlying texels' colors are kept unless the texture is flagged as transparent.
- -decal
- Do not use. Creates VMTs using DecalModulate shader and $alphatest parameter.
- As this is not faithful to how GoldSrc decals work,
WadMaker should be used to convert the decals instead (if necessary, using an image editor to pad all edges to the next power of two), and the VMTs created manually as LightmappedGeneric with $translucent 1, $decal 1, and $decalscale 1.
Readme
Help from xwad run without any parameters (some information is inaccurate and/or misleading):