PivityGmodStore

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.

  1. $basetexture: defines what texture to use for the material (vtf)
  2. $basetexturetransform:
  3. center: defines the point of rotation
  4. scale: fits the texture into the material the given number of times
  5. rotate: rotates the texture counter-clockwise in degrees
  6. translate: shifts the texture by the given numbers

  1. $detail: texture that will be used to add high-resolution detail to a material when it is viewed up close (vtf)
  2. $detailscale: fits the detail texture onto the material the given number of times
  3. $detailblendmode: how to combine the detail material with the albedo
  4. $detailblendfactor: controls the amount that the detail texture affects the base texture
  5. option 5 and 6 can be used to make the detail glow in the dark

  1. $bumpmap: textures that contain 3d lighting details (vtf)

  1. $reflectivity: how much light the material should bounce off

  1. $phong: turn on phong shading for better reflections
  2. $phongboost: overbrightening factor
  3. $phongtint: color of the reflection

  1. $selfillum: allow brightness in the dark
  2. $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.

  1. Proxies: allows the engine to manipulate material properties
  2. AnimatedTexture: specify a list of properties for an animated texture
  3. animatedtexturevar: the animated texture (vtf)
  4. animatedtextureframenumvar: frame variable to increment
  5. animatedtextureframerate: speed of the animated in frames per second


"VertexLitGeneric"
{

"$basetexture" "z_easyskins/camo/dark_matter"

"Proxies"
{
"AnimatedTexture"
{
"animatedtexturevar" "$basetexture"
"animatedtextureframenumvar" "$frame"
"animatedtextureframerate" "15"
}
}
}