Introduction: How to Make Textures for Any Game Using the Source Engine
This tutorial will show how to make a basic texture for any source game, such as; Half Life 2, Half Life 2: episode 1, Half Life 2: episode 2,Counter-Strike: Source and many others.
When I started making custom textures, I found that is was very overwhelming, and I very quickly got lost. It is however; easy - as long as you have the necessary programs.
So, without further ado, let's get on with this Instructable!
Step 1: The Basics of Mapping and SDK
This tutorial assumes you have a very basic knowledge of Source SDK and Hammer.
Both these items are only acquirable through "Steam" (http://en.wikipedia.org/wiki/Steam_%28content_delivery%29). While Source SDK is free, to obatin it, you will need a copy of a source game, which does cost money.
Source SDK is the Source Development Kit that comes with any source game, such as Counter-Strike: Source. To obtain it, simply open up steam, go into your "tools" tab and either double click on "Source SDK" or right click on it and press "Resume updating".
Step 2: Acquiring the Neccessary Programs
To make textures, you will need some image editing software, a text editing program (such as notepad or notepad++) OR VTFEdit. That is all.
I would recommend Paint.NET, as it is free, has many features and is very easy to use.
You can Paint.NET here.
If you want to make repetitive textures, you will need something that is capable of tiling images. Paint.NET is unfortunately unable to do this, you can, however, use GIMP.
You can get GIMP here.
To make your texture image into a Valve Texture File (we'll go over this in a moment) you will need VTFEdit. VTFEdit is also capable of making Valve Material Files (we'll go over this too).
You can get VTFEdit here.
Okay. That's all the programs you'll need, now to explain what is actually required in a texture!
Sorry for the crappy pics. There arn't really any relevant pictures, other than these, for this section.
Step 3: What Does a Custom Texture Consist Of?
OK, a custom texture, or any texture, consists of two things; a .vtf and a .vmt.
.Valve Texture File
.Valve Material File
.vtf is a custom image format, made specifically for valve's source games. It is the image itself that you want your texture to be.
.vmt is the custom text format, made specifically for valve's source games also. It is what determines what the texture will be (i.e. rock, grass, dirt etc.). It is the textures properties.
Both are necessary for your texture to work properly.
Step 4: Finding an Image to Use for Your Texture
You can use any image for use ingame as a texture, but for the sake of this tutorial, I will be using a picture of some sand.
The picture is available here.
I found this picture by simply searching for "sand" on google images.
There are websites, that provide hundreds of .jpeg's to make textures, although you usually have to pay for these.
Step 5: Tiling Your Image and Converting It Into the Right Format
I would recommend using paint.NET or a similar program to edit and play with images, but since my sand texture doesn't need to be edited, I can open it straight into GIMP.
Once you've opened it in GIMP, go into "Filter > Map > Make Seamless"
As you can see from image two, it is seamless, and is now ready to be tiled and used in a map.
However, we still have to convert it and create a .vmt.
Converting it is incredibly simple.
Firstly, save your texture image in .TGA format.
Once saved, open it in VTFEdit by clicking "file" then "import" and selecting your .TGA texture image.
Once you've done that save it again, in .vtf format in the directory or your choice.
It will also create a .vmt in the directory you selected.
Step 6: .vmt's - Valve Material File's
Valve MAterial Files are vital for any texture to work.
The following is an example of one (it is from the sand texture):
It is incredibly basic, and pretty much the simplest .vmt you can have.
This means the base texture of this texture file is "sand". When made automatically by VTFEdit, it will also write the directory of where you saved it. For instance; "$basetexture" "steamapps\steam name\halflife2\hl2\materials\sand"
This is bad, because if you, for instance, saved it in a folder called "my custom textures" on your desktop, then when you moved the .vmt and .vtf to halflife2\hl2\materials, then it wouldn't work, because the directory in the .vmt would be desktop\my custom textures\texture name which is incorrect. To get around this, and use your textures in any source game, put all your textures into a folder called "custom textures" so the .vmt says custom textures\texture name, then simply copy the folder to your games directory.
This means that if you shoot and/or walk on this texture in game, it will play sounds of sand being shot or walked on. Different surfaces do different things, and some surfaces cause the texture to be shiny.
Step 7: Accessing Your Textures in Hammer and Your Source Game
To access any custom textures in Hammer, they first need to be put in the game directory you are mounting. The game you are mounting and the Source engine type is displayed at the bottom of Source SDK.
We are going to put our texture into Half Life 2, however, this method works for most source games. First, you have to have to find and open your steam folder.
This is usually in Program files\Steam (or in my case steam2, but that won't affect your directory). From there, open "Steamapps" then your username, then "Half Life 2", then "hl2".
This folder is where a large proportion of important game files are, so be careful not to delete or alter anything unintentionally.
There will most likely be no "materials" folder here. If there is not, you need to make one. Make sure there are no typos in the name.
Open the materials folder and copy your texture into it. for me, those files were sand.vtf and sand.vmt.
Open up your .vmt and double check the directory in there is correct. For me, it was materials\sand.
Step 8: Conclusion
Right. Now we should have a .vmt called sand.vmt, a .vtf called sand.vtf all in our Half Life 2 directory (or whatever game you were using). The .vmt should say "materialssand".
If you have all these things, then it will work. If your .vmt or .vtf is corrupt, neither will work.
I know that my texture needs a bit of work, but it is definitely seamless and is definitely in the game (I'm using GMod by the way).
I hope this tutorial was helpful, and to prove that it is do-able following my instructions:
We have a be nice policy.
Please be positive and constructive.