Xwad: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{lang|Xwad}}
{{lang|Xwad}}
{{note|Most first-party games don't have a copy of this tool; the version of the tool found in the [steam://install/211 old "SourceSDK" depot] can still be used for any branch (all 4 included versions of xwad.exe are the same).}}
{{note|Most first-party games don't have a copy of this tool; the version of the tool found in the [steam://install/211 old "SourceSDK" depot] can still be used for any branch (all 4 included versions of xwad.exe are the same).}}
A copy of this [[command-line]] tool can be found in follwing 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 toVTF, use the [[Convert WAD to VMT...]] button in {{hammer4|4.1}} File menu {{not|{{hammer++}}}}.
After running XWAD and converting the textures toVTF, use the [[Convert WAD to VMT...]] button in {{hammer4|4.1}} File menu {{not|{{hammer++}}}}.

Revision as of 07:50, 8 August 2023

English (en)Русский (ru)Translate (Translate)
Note.pngNote: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).

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 toVTF, use the Convert WAD to VMT... button in Hammer Hammer 4.x File menu (not in Hammer++).

Caveats

Icon-Bug.pngBug: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.
PlacementTip.pngWorkaround:Convert the output folder(s) to BGRA8888 using VTFEdit VTFEdit, then use VIDE VIDE's VTF converter to convert the textures that should be opaque to BGR565 or BGR888.
  [todo tested in ?]

Readme

Help from xwad run without any parameters:

[-AutoDir] Automatically detects -basedir and -wadfile or -bmpfile based on the last parameter (it must be a WAD file or a BMP file. [-decal] Creates VMTs for decals and creates VMTs for model decals. [-onlytex <tex name>] [-shader <shader name>] Specify the shader to use in the VMT file (default is LightmappedGeneric. [-vtex] If -vtex is specified, then it calls vtex on each newly-created .TGA file. [-vmtparam <ParamName> <ParamValue>] if -vtex was specified, passes the parameters to that process. Used to add parameters to the generated .vmt file -BaseDir <basedir> -game <basedir> Specifies where the root mod directory is. -WadFile <wildcard> -wadfile will make (power-of-2) TGAs, VTFs, and VMTs for each texture in the WAD. It will also place them under a directory with the name of the WAD. In addition, it will create .resizeinfo files in the materials directory if it has to resize the texture. Then Hammer's File->WAD To Material command will use them to rescale texture coordinates. -bmpfile <wildcard> -bmpfile acts like -WadFile but for BMP files, and it'll place them in the root materials directory. -sprfile <wildcard> Acts like -bmpfile, but ports a {{sprite}}. -Transparent (BMP files only) If this is set, then it will treat palette index 255 as a transparent pixel. -SubDir <subdirectory> -SubDir tells it what directory under materials to place the final art. If using a WAD file, then it will automatically use the WAD filename if no -SubDir is specified. -Quiet Don't print out anything or wait for a keypress on exit. ex: xwad.exe -vtex -BaseDir c:\hl2\dod -WadFile c:\hl1\dod\*.wad ex: xwad.exe -vtex -BaseDir c:\hl2\dod -bmpfile test.bmp -SubDir models\props ex: xwad.exe -vtex -vmtparam $ignorez 1 -BaseDir c:\hl2\dod -sprfile test.spr -SubDir sprites\props