Title: Introduction to Half Life 2 Modding
1Introduction to Half Life 2 Modding
- Seminar Five The Texturiser
- The story so far
- Creating a mod via Source SDK
- Introduction to Hammer
- Basic Hammer techniques
- Advanced Hammer techniques
- This week
- Importing custom textures for use in maps
- Homework
- Further work with custom textures
2The 'Valve' way
- SDK provided tool Vtex.exe
- Vtex used to convert TGA files into VTF files
- Command line tool
- Basic usage vtex.exe texture_source.tga
- Uses the source directory to position final VTF
files - i.e. if texture_source.tga is in
materialsrc\walls\, texture_source.vtf will be
created in materials\walls. - Can also be used to generate VMT files.
3The Easy way
- Use a Photoshop plugin
- Nem's VTF Plugin
- nemesis.thewavelength.net/index.php?c154
- Allows VTF generation via Save As dialogue (see
right). - Faster and Easier than VTex!
4Creating a VMT
- Each VTF requires a matching VMT
- VMT files describe what shader and properties the
VTF is rendered with. - VMT files are simple text files with a specific
format. - The format of the VMT is as follows
- Shader declaration
- LightMappedGeneric and VertexLitGeneric are
the most common shader types used. - Parameter declarations
- baseTexture is a requirement for majority of
shaders
5Example VMT
"lightmappedgeneric" // shader parameter //
diffuse texture (vtf file) "baseTexture"
"wall/ds_wall_metal_hullplate01" // surface
type for hit impacts "surfaceprop" "metal"
// normal map (also a vtf) "bumpmap"
"wall/ds_wall_metal_hullplate01_normal" //
tells engine to use env_cubemap output "envmap"
"env_cubemap" // env mask is taken from base
map alpha "basemapalphaenvmapmask" 1 //
dictates env map contrast / saturation "envmapco
ntrast" 1 // RGB value, controls level of
reflection "envmaptint" ".25 .25 .25"