texturename
and the created files will be texturename.vtf
and texturename.vmt
.
File > Import...
and select your texture image file. You will be presented with a range of options, but the defaults are fine. Click OK to continue.File > Save
and save the VTF file to <mod directory>\materials\texturename.vtf
.Tools > Create VMT File
. You will have some more options, but the defaults will work correctly. Click Create and save the VMT file to <mod directory>\materials\texturename.vmt
.bin
folder of the game install. For example, for HL2, it is located at <steam install>\SteamApps\common\Half-Life 2\bin\vtex.exe
. VTEX is a command line tool which means it can support more advanced scripting techniques to convert textures in batches rather than one at a time. If you're not familiar with command line tools, you should use VTFEdit instead.
vtex.exe
without any parameters, the usage instructions will be printed:
Usage: vtex [-outdir dir] [-quiet] [-nopause] [-mkdir] [-shader ShaderName] [-vmtparam Param Value] tex1.txt tex2.txt . . .
-quiet : don't print anything out, don't pause for input
-warningsaserrors : treat warnings as errors
-nopause : don't pause for input
-nomkdir : don't create destination folder if it doesn't exist
-vmtparam : adds parameter and value to the .vmt file
-outdir <dir> : write output to the specified dir regardless of source filename and vproject
-deducepath : deduce path of sources by target file names
-quickconvert : use with "-nop4 -dontusegamedir -quickconvert" to upgrade old .vmt files
-crcvalidate : validate .vmt against the sources
-crcforce : generate a new .vmt even if sources crc matches
eg: -vmtparam $ignorez 1 -vmtparam $translucent 1
Note that you can use wildcards and that you can also chain them
e.g. materialsrc/monster1/*.tga materialsrc/monster2/*.tga
Hit a key to continue
In the bin
folder, there's also a vtex.bat
folder that sets some environment variables to make things a bit easier to deal with. This is a simple batch file that just calls vtex.exe
, there's nothing magic about it.<mod folder>\materialsrc
directory as TGA files. You can create subfolders in this directory to reflect the folder structure you want in the materials
directory. You do not include the materialsrc
folder when releasing your map/mod.materialsrc
folder before you continue..\bin\vtex.bat .\hl2\materialsrc\texturename.tga
<steam>\SteamApps\common\Half-Life 2> .\bin\vtex.bat .\hl2\materialsrc\texturename.tga
Configuring Source SDK environment variables for Half-Life 2
VPROJECT=F:\Steam\SteamApps\common\Half-Life 2\bin\..\hl2
Executing: ".\bin\vtex.exe" -game ".\bin\..\hl2" .\hl2\materialsrc\texturename.tga
input file: ./hl2/materialsrc/texturename
output directory: ./hl2/materials
no config file for ./hl2/materialsrc/texturename.tga
SUCCESS: Vtf file created
Hit a key to continue
materials
directory and call it the same name as your texture, except with the extension .vmt
. Open this file in Notepad or any other text editor. Add the following content to the file:
LightmappedGeneric
{
"$basetexture" "texturename"
}
Save the file and close Notepad. You can now open Hammer and apply your texture to a wall, then compile and run your map!
You must log in to post a comment. You can login or register a new account.
VTFedit its the same, you just need to get the texture files and the text file in your folder.