This article was converted from a previous version of TWHL and may need to be reviewed
- The formatting may be incorrect due to differences in the WikiCode processing engine, it needs to be revised and reformatted
- Some information may be out of date
- After the article is re-formatted and updated, remove this notice and the Review Required category.
- Some older tutorials are no longer useful, or they duplicate information from other tutorials and entity guides. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.
At the time of writing, vtex.exe was the only tool avaliable to create Source textures. Nowadays, you can also use VTFEdit, a tool that is far more accesible to those who find vtex difficult/annoying (me included!) - AntOkay, so you've seen the regular HL? textures used over and over again. You want to create your own textures to liven your map and add some originality. The only problem is, HL? textures are more complicated to create than a simple WAD file. You can, however, create much more realistic textures using new methods.
What You NeedAll you need is
vtex.exe from your
SteamSteamAppsyourusernamesourcesdkbin folder, plus a little imagination to actually make the texture (or a photo or similar, already prepared).
Step 1: Preparing FoldersN.B.: you may have to create the "sdkcontent" and "materialsrc" subfolders referred to here if you have not used the SDK up to recently. Go to your
sourcesdksdkcontentmaterialsrc directory and create a folder. Name it something related to your map: in this tutorial I'll call this folder
mytexes. Now, go to your game's material directory (in the case of HL?DM it would be
half-life 2 deathmatchhl2mpmaterials and in the case of CS:S it would be
counter-strike sourcecstrikematerials) and create another folder, with the same name as your previous one.
Step 2: Preparing VTEXNow that you have set up your material directories, you must set up VTEX so that it will output all the right files to the right directories. Go to your bin folder (
SteamSteamAppsyourusernamesourcesdkin) and find
vtex.exe. Right click on it and go to
Send To, then to
Desktop (create shortcut) as illustrated below (may vary slightly according to your version of Windows):
The Send To menu Step 3: Making Your TextureNow that you have finished all of your preparation, it is time to actually create your texture. First, you will have to have a Targa image file (.TGA) (it
must be Targa). Export that from your preferred image editing program (
IrfanView is a free program very capable of converting from a large variety of popular formats, and to Targa, if you don't have one).
Now export it to your directory that you created earlier (
sourcesdk_contentmytexes). Open Windows Explorer or your alternative and go to the directory you exported the TGA to. Click your TGA and drag-and-drop it onto your shortcut to VTEX.
If this pops up, you have done everything correctly and can move on to step 4:
A successful VTEX process In this situation, I have made the folder in the materialsrc folder, but not in the game material folder - I have created only one of the two required folders for your textures. If this is the case, refer back to Step 1.
A failed VTEX process Step 4: Adding Material AttributesNow that you have created your actual texture, it is time to create its material attributes (what it sounds like when dropped, whether it has any special cubemap properties etc.). If you are going for a basic texture with no specific material properties, then follow the instructions below.
When you ran VTEX, it made an empty .txt file in your
materialsrcmytexes folder. Open it with notepad or your selected text editor. Paste this in it:
"LightmappedGeneric"
{ "$basetexture" "yourfoldername/yourtexname" }
In the place of each
yourtexname insert the name of your material (this being the name of your TGA) and in the place of
yourfoldername insert the name of your texture folder (for me it would be
mytexes).
Now, go to File -> Save As (
not just 'Save'), and find your material directory (in the case of HL?DM it would be half-life 2 deathmatchhl2mpmaterialsmytexes and in the case of CS:S it would be counter-strike sourcecstrikematerialsmytexes). Once you are in the correct directory, enter "
yourtexname.vmt"
with quote marks as so:
The Save As dialog You can now open Hammer and apply your texture to a wall, then compile and run your map!
VTFedit its the same, you just need to get the texture files and the text file in your folder.