VMT
Introduction
A material is a .vmt ("Valve Material Type") text file that defines a two-dimensional surface. It contains all of the information needed for Source to simulate the surface visually, aurally, and physically.
Creation
To create a .vmt file simpely create a .txt file and change the extension.
Standard Material
Here are some of the parameters used when creating a texture.
- $basetexture: defines what texture to use for the material (vtf)
- $basetexturetransform:
- center: defines the point of rotation
- scale: fits the texture into the material the given number of times
- rotate: rotates the texture counter-clockwise in degrees
- translate: shifts the texture by the given numbers
- $detail: texture that will be used to add high-resolution detail to a material when it is viewed up close (vtf)
- $detailscale: fits the detail texture onto the material the given number of times
- $detailblendmode: how to combine the detail material with the albedo
- $detailblendfactor: controls the amount that the detail texture affects the base texture
- option 5 and 6 can be used to make the detail glow in the dark
- $bumpmap: textures that contain 3d lighting details (vtf)
- $reflectivity: how much light the material should bounce off
- $phong: turn on phong shading for better reflections
- $phongboost: overbrightening factor
- $phongtint: color of the reflection
- $selfillum: allow brightness in the dark
- $selfillummask: dedicated mask texture for the effect. (vtf)
"VertexLitGeneric"
{
// Defining the base texture //
$basetexture "z_easyskins/camo/craze"
$basetexturetransform "center .5 .5 scale 7 7 rotate 0 translate 0 0"
// Adding detail for up close viewing //
$detail "z_easyskins/camo/craze"
$detailscale "7"
$detailblendmode "0"
$detailblendfactor "0.9"
// Used by the gold camo to give a gold reflection //
$bumpmap "z_easyskins/camo/gold"
$reflectivity "[1 1 1]"
$phong "1"
$phongboost "1"
$phongtint "[1 0.93 0.39]"
// Glow in the dark //
$selfillum "1"
$selfillummask "camo/vtf/weed"
}
Animated Material
An animated material can also use all previously explained parameters.
- Proxies: allows the engine to manipulate material properties
- AnimatedTexture: specify a list of properties for an animated texture
- animatedtexturevar: the animated texture (vtf)
- animatedtextureframenumvar: frame variable to increment
- animatedtextureframerate: speed of the animated in frames per second
"VertexLitGeneric"
{
"$basetexture" "z_easyskins/camo/dark_matter"
"Proxies"
{
"AnimatedTexture"
{
"animatedtexturevar" "$basetexture"
"animatedtextureframenumvar" "$frame"
"animatedtextureframerate" "15"
}
}
}