In this tutorial i will be explaining how to make a texture that can be used in any source-based game.
Tools used:
Image editor such as GIMP, Paint.net, or Photoshop.
[VTFEdit](http://nemesis.thewavelength.net/index.php?c=178)
SourceSDK
IMAGE EDITOR
Your texture MUST be a power of 2.
Example:
256x512
256x1024
64x512 (not rcomended, but still usable)
or just plain 512x512.
VTFEDIT
Make your image save it as a .tga file.
Load up VTFEdit and press Import. Once you have found your .tga texture select it and press ok.
Once you press okay, you might see this:
http://developer.valvesoftware.com/w/images/archive/8/86/20080320133246!Vtfedit_importoptions.png And you are thinking “What the hell is all this?” Well its quite simple actually.
Normal Format is the format the texture uses if it doesn’t have an alpha channel.
Alpha Format is the format the texture uses if it does have an alpha channel.
Texture Format is the format the texture will be used for.
[ul]Animated Texure is most common, even if the texture is not animated. There are also the environment map format but that is for reflections and stuff, i.e. custom reflection, which can be selected in the $envmap parameter later (see below). And there is volume texture, which I am not to sure what it is for.[/ul]See more. See more2.
Resize: Kind of obvious don’t you think? You can resize your texture to whatever you want.
**
Important:** Mipmaps are like LOD (level of detail) on your textures. If you have no Mipmaps for your texture, you will have a grain effect from far away. http://i163.photobucket.com/albums/t319/FirePawX/dm_sandtrap_m0004.jpg
Generate Normal Maps
[ul]This is used to create our bumpmaps later on, do not use this if you don’t have bumpmaps on your textures.[/ul] If you generate bumpmaps save the file as _normal.vtf so its easy to remember.
Once you have your image, we can write our .vmt (Valve Map Texture) I personally use notepad, but you can use notepad++ or whatever you perfer.
Open our text editor.
Now of course there are a bunch of different types of shaders you can use:
LightmappedGeneric
Patch
Refract
SpriteCard
UnlitGeneric
UnlitTwoTexture
VertexLitGeneric
Water
WorldTwoTextureBlend
WorldVertexTransition
Each is used for a different type of texture.
I’ll only explain a few textures that you will most likely use.
“LightmappedGeneric” Is most commonly used for texturing a wall, or rock, or anything that uses Lightmaps to apply shadows and lighting. See more.
“UnlitGeneric” Used for making textures full bright, they are not effected by lightmaps. See more.
“UnlitTwoTexture” Used for making fullbright texture with a blend; Have one texture blend into another by making it a displacement and painting alpha. See more.
“VertexLitGeneric” Used to render models. Although I’m not sure how lighting is calculated on it, I assume by the name it works from the vertexes (vertecies?) on how its lit. See more.
“Water” Take a guess, you can make water textures with it. Water refracts cubemaps or the world depending if it is a cheap or expensive material. See more.
“WorldVertexTransition” Used to render a blend between two textures. Most commonly used on displacements, you can use the blend texture on non-displacements, but you cannot change the texture unless you turn it into one and use the “paint alpha tool.”
See more.
Once we have our selected shader we can go ahead and choose what our effects are.
Example:
LightmappedGeneric
{
$basetexture "custom/texture01"
$surfaceprop "brick"
$bumpmap "custom/texture01_normal"
}
the $bumpmap effect is used to give the illusion of having a 3D texture instead of a flat texture.
Example:
http://developer.valvesoftware.com/w/images/d/d2/Example_of_bump_mapping.jpg
The $surfaceprop parameter tell the source engine what kind of surface properties it has, such as brick, concrete, sand, grass, ect…See more.
We could also add in the $envmap parameter to our texture to give it a type of shine to it. This can be accomplished by using an env_cubemap.
$envmap "env_cubemap"
See more.
Once we have our .vmt written, we can go ahead and save it. Save the .vmt with the same name as the .vtf you have, inside the same folder. We do not need to create a seprate .vmt for our texture01_normal. [ul]Example folder:
C:\Program Files\steam\steamapps\Firegod522\materials\custom\Texture01.vmt
C:\Program Files\steam\steamapps\Firegod522\materials\custom\Texture01.vtf
C:\Program Files\steam\steamapps\Firegod522\materials\custom\Texture01_normal.vtf[/ul]
Once we load up hammer editor we can type in custom/ as the filter and we should have texture01 show up in the list. Apply it to your brush/displacement (whichever you chose) and compile!