Making custom textures
1. Okay so first you need your texture. In source the textures need to be in TGA format, you can easily save it in that format if you use Photoshop. The image size follows the same rules as before, sizes like 8, 16, 32, 64, 128, 256, 512, 1024, etc. are allowed, they are all powers of 2, and there isn't really a limit for how big they are, but I guess 1024x1024 is more then enough.
2. Now in order to use your texture you need to create a folder in Valve\Steam\Steamapps\username\sourcesdk_content\cstrike\materialsrc
give the folder any name you want and put all your .tga files in there. You can also have a txt file with the same name as your texture with some commands, which will be executed when you compile the texture. The commands are:
$nolod Do not use lower quality versions of this texture in lower Direct X versions
$nomip Do not make mip-levels for this texture
$clamps / $clampt Do not allow the texture to wrap in the S or T coordinate space, respectively. This is most often used for sprites that are not tiled
$skybox Used for compiling skyboxes. This assures the edges match between each facet
$startframe (integer) / $endframe (integer) Used for animated textures. Textures must be named as texture000, texture001, texture002, etc. The $startframe defines the beginning frame and the $endframe defines the ending frame.
$nocompress Do not use compression on this texture. Useful for textures with fine gradation (like light halos)
$nonice Do not use NICE filtering on this texture’s lower mip-levels
$dxt5 Use DXT5 compression instead of full compression
3. Now comes the hard part although it's not that hard. Go to Valve\Steam\SteamApps\username\sourcesdk\bin\ and you'll find in there a exe called VTEX. Now right click on it and select the "create shortcut" option. This will create a shortcut to that program in which we can add several command options, so open the shortcut properties and in the end of the target field add the following commands:
-mkdir -shader LightmappedGeneric "C:\Valve\Steam\SteamApps\username\sourcesdk_content\cstrike\materialsrc\texturedir\*.tga"
(remember to change username, texturedir & *.tga to your relevent names)
So what this does is, create a new folder, then tells the program which shader your using, in this case lightmappedGeneric, but you can use whatever shader you want, then it picks up all the TGA files in the folder you pointed, and converts them in to VTF and VMF, which are your materials files.
If you go to Valve\Steam\Steamapps\usename\counter-strike source\cstrike\materials
you'll see your materials folder in there, and if you open it you will see a VMF, and a VTF, with your texture name.
4. The last thing to do it's to edit the VMT files so that they act like they are supposed to, basically we are going to say to the engine that this is wood, this is metal, this is concrete etc. So open a VMT file in notepad, you will see something like:
After the "$basetexture" line add "$surfaceprop" "materialname" in wich you replace the materialname for the type of material your texture is. The following names are the some types of materials you can add:
I didn't test all of this materials so some may not work, or need some specific settings.
I would like to thank BaRRaKID @ Interlopers for this tutorial
I hope this helps all that uses it