Introduction to Half Life 2 Modding

5
Introduction 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

description

Introduction 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. - PowerPoint PPT Presentation

Transcript of Introduction to Half Life 2 Modding

Page 1: Introduction to Half Life 2 Modding

Introduction 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

Page 2: Introduction to Half Life 2 Modding

The '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.

Page 3: Introduction to Half Life 2 Modding

The Easy way

● Use a Photoshop plugin– Nem's VTF Plugin

● nemesis.thewavelength.net/index.php?c=154– Allows VTF generation via

Save As dialogue (see right).● Faster and Easier than VTex!

Page 4: Introduction to Half Life 2 Modding

Creating 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

Page 5: Introduction to Half Life 2 Modding

Example 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"$envmapcontrast" 1

// RGB value, controls level of reflection"$envmaptint" "[.25 .25 .25]"

}