Skip to content

VMTs 101

VMT's stand for Valve Material.. Text? I don't know and it doesn't matter... Basically, its a text file that requires some special formatting...

Heres how it works

"SHADERNAME"
{
   "$Parametername" "Value"
   "$Parametername" "Value"
   "$Parametername" "Value"
   "$Parametername" "Value"
   "$Parametername" "Value"
}

Congratulations you now know how VMT's work. Some things to keep in mind when writing VMT's.

  1. "Just" "put" "everything" "in" "brackets" I don't want to explain why. Just do it. But basically, you can mess up a VMT by not having them. It doesn't hurt if you do have them. So just spam the "
  2. Vector and Color parameters must be in [ ] brackets.
  3. Parameters are not case sensitive, but Proxies outside of "" ARE case sensitive!

Parameter types and what they want

// This starts in materials/ folder of the game/mod
$TextureParameter  "Path\VTF Filename ( without extension )"
$BooleanParameter  "0 or 1"
$IntegerParameter  "-65536 to 65536"
$FloatParameter         "Float values, negative or positive"
$MatrixParameter  " I won't put this here. just copy it from the VDC "
$ColorParameter   "[R G B]" // float values
$VectorParameter(s)  "[X Y]" // Vec2 Parameters
$VectorParameter(s)  "[X Y Z]" // Vec3 Parameters
$VectorParameter(s)  "[X Y Z W]" // Vec4 Parameters
$StringParameters  "You won't really see any of these, anytime soon."

You can find a list of VMT Parameters that are accepted by our PBR Shader,

shader parameters

PBR Example of the above

Here's some Pseudo VMTs that would work with our PBR Shader.

Models :

"PBR_MODEL"
{
   "$BaseTexture" "models/props_pbr/modelX_BC"
   "$NormalTexture" "models/props_pbr/modelX_NdxH"
   "$MraoTexture" "models/props_pbr/modelX_MRAO"
   "$Detail"  "models/props_pbr/modelX_SSBump"

   // Boolean Parameter
   "$InternalBoolWVT" "0"

   // Integer Parameter
   "$DetailBlendMode" "11"

   // Float Parameter
   "$DetailBlendFactor" "0.5"

   // Vector Parameter
   "$EnvMapTint"  "[1 0 0]"

   // StringParameter
   "$MaterialName"  "The Shader Sets this automatically"
}

Brushes :

"PBR"
{
    "$BaseTexture" "rocks/RockX_BC"
    "$NormalTexture" "rocks/RockX_NdxH"
    "$MraoTexture" "rocks/RockX_MRAO"
}

Note

The Shader automatically detects if the VMT its using is located within the models folder and force PBR_MODEL if so.