Template:Archived page history/Xwad/en: Difference between revisions
Jump to navigation
Jump to search
Note:Most first-party games don't have a copy of this tool; the version of the tool found in the old "SourceSDK" depot can still be used for any branch (all 4 included versions of xwad.exe are the same).
Bug:Xwad always outputs pixels that used index 255 as transparent, even if they aren't flagged as such[Elaborate?]. Only textures that are flagged as transparent will have the transparent pixels modified to work better with texture filtering.
Workaround:Convert the output folder(s) to BGRA8888 using
VTFEdit, then use
VIDE's batch VTF converter to convert the textures that should be opaque to BGR565, BGR888, or DXT1.
[todo tested in ?]
Important:Xwad does not support textures with more than 262144 pixels (ex: 512x512 resolution).
m (Reverted edits by SirYodaJedi (talk) to last revision by Thunder4ik) Tag: Rollback |
Tag: Undo |
||
Line 3: | Line 3: | ||
A copy of this [[command-line]] tool can be found in following folder: {{file|common\SourceSDK\bin\<nowiki><</nowiki>branchname<nowiki>></nowiki>\bin\xwad|exe}}. This tool can convert [[WAD]], [[Wikipedia:Windows bitmap|BMP]], and [[SPR]] files to [[TGA]] and accompanied [[VMT]] files, as well as call [[vtex]] to generate associated [[VTF]] files. | A copy of this [[command-line]] tool can be found in following folder: {{file|common\SourceSDK\bin\<nowiki><</nowiki>branchname<nowiki>></nowiki>\bin\xwad|exe}}. This tool can convert [[WAD]], [[Wikipedia:Windows bitmap|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 | After running XWAD and converting the textures to VTF, use the [[Convert WAD to VMT...]] button in {{hammer4|4.1}}'s File menu {{not|{{hammer++}}}} to automatically add material paths and fix the scaling of previously non-power-of-two textures. | ||
{{todo|The 28 June 2024 update to {{jb3|4}} includes a build of xwad with several bugfixes and extra features; document these properly. They include: | |||
* Increases max resolution cap to allow textures up to 8192x8192. | |||
* Add support for WAD2 format (using {{code|-palfile}} param to provide [[palette]], defaulting to Quake 1 palette). | |||
* Fix processing of decals | |||
* Extract sprite groups from SPR files | |||
* Include approximate values for [[water (shader)|water]] fog in generated VMTs | |||
}} | |||
== Caveats == | == Caveats == | ||
{{bug|Xwad always outputs pixels that used index 255 as transparent, even if they aren't flagged as such{{elaborate}}. Only textures that are flagged as transparent will have the transparent pixels [[$translucent#Filtering_Borders|modified to work better with texture filtering]].{{workaround|Convert the output folder(s) to BGRA8888 using {{vtfedit|2}}, then use {{vide|2|addtext='s}} VTF converter to convert the textures that should be opaque to BGR565 or | {{bug|Xwad always outputs pixels that used index 255 as transparent, even if they aren't flagged as such{{elaborate}}. Only textures that are flagged as transparent will have the transparent pixels [[$translucent#Filtering_Borders|modified to work better with texture filtering]].{{workaround|Convert the output folder(s) to BGRA8888 using {{vtfedit|2}}, then use {{vide|2|addtext='s}} batch VTF converter to convert the textures that should be opaque to BGR565, BGR888, or DXT1. | ||
}} }} | }} }} | ||
{{modernImportant|Xwad does not support textures with more than 262144 pixels (ex: 512x512 resolution).}} | |||
== Syntax == | |||
{{stub}} | |||
== Options == | |||
{{stub}} | |||
=== Required === | |||
; {{code|-basedir <path>}} | |||
: Location of [[gameinfo.txt]]. | |||
: If xwad is called from the {{path|materialsrc}} directory, then {{code|..}} will suffice. | |||
; {{code|-wadfile <file>.wad}} | |||
; {{code|-bmpfile <file>.bmp}} | |||
; {{code|-sprfile <file>.spr}} | |||
Convert a [[WAD]], [[BMP]], or [[SPR]], respectively. Accepts preceding file paths and wildcards. | |||
=== Optional === | |||
; {{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. | |||
: 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. | |||
; {{code|-decal}} | |||
: '''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 [[decals (GoldSrc)|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}}. | |||
: {{tip|For decals and IndexAlpha sprites, consider using A8 texture format and defining color in the VMT using {{ent|$color}}, as this retains the full original quality while being the same size as a DXT5 texture of the same resolution.}} | |||
; {{code|-vmtparam <parameter> <value>}} | |||
: Add the described material parameter to the VMTs of all converted textures. | |||
: To add multiple parameters, use multiple {{mono|-vmtparam}} arguments. | |||
: Despite what the readme says, this has nothing to do with {{vtex|2}}. | |||
== Readme == | == Readme == | ||
Help from xwad run without any parameters: | Help from xwad run without any parameters (some information is inaccurate and/or misleading): | ||
{{codeblock|<nowiki> | {{codeblock|<nowiki> | ||
[-AutoDir] | [-AutoDir] | ||
Line 41: | Line 80: | ||
them in the root materials directory. | them in the root materials directory. | ||
-sprfile <wildcard> | -sprfile <wildcard> | ||
Acts like -bmpfile, but ports a | Acts like -bmpfile, but ports a sprite. | ||
-Transparent (BMP files only) | -Transparent (BMP files only) | ||
If this is set, then it will treat palette index 255 as a | If this is set, then it will treat palette index 255 as a |
Revision as of 20:39, 28 June 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.
Todo: The 28 June 2024 update to
Jabroni Brawl: Episode 3 includes a build of xwad with several bugfixes and extra features; document these properly. They include:

Caveats





Syntax
Options
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 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.
Tip:For decals and IndexAlpha sprites, consider using A8 texture format and defining color in the VMT using $color, as this retains the full original quality while being the same size as a DXT5 texture of the same resolution.
- -vmtparam <parameter> <value>
- Add the described material parameter to the VMTs of all converted textures.
- To add multiple parameters, use multiple -vmtparam arguments.
- Despite what the readme says, this has nothing to do with
VTEX.
Readme
Help from xwad run without any parameters (some information is inaccurate and/or misleading):