VMT
{{subst:#if:|||
Important step for replacing wikilinks after you've created this page
After you click 'Edit' do what the image shows. If you can't see editing toolbar you need to enable it in 'Preferences' -> Editing -> checkbox 'Enable the editing toolbar'
![]() |
参见: {{LAuto}}
|
--- DON'T JUST BLINDLY DELETE THIS PART. DO REPLACE THE LINKS AND CATEGORIES. THE PICTURE SHOWS HOW TO USE IT ! ---
SEARCH FOR: \[\[(?!#|File(?:[ _]talk)?:|Image(?:[ _]talk)?:|Media:|Template(?:[ _]talk)?:|MediaWiki(?:[ _]talk)?:|Talk:|Category[ _]talk:|Project[ _]talk:|Valve[ _]Developer[ _]Community[ _]talk:|Help[ _]talk:|User(?:[ _]talk)?:|c:|commons:|Dictionary:|Google:|GoogleGroups:|IMDB:|M:|Meta:|Metawikipedia:|MW:|SdkBug:|SourceForge:|Steampowered:|W:|Wiki:|WikiBooks:|Wikipedia:|Wikiquote:|Wiktionary:|WP:)(:?(?:Category|Category|Help|Project|Valve[ _]Developer[ _]Community|Special|)(?:[^\|\]]+))(\|?.*?)\]\]
REPLACE WITH: {{subst:LAuto|$1$2}}
}}
As a courtesy, please do not edit this while this message is displayed.
If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page.
The person who added this notice will be listed in its edit history should you wish to contact them.

You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)
A VMT ("Valve Material") file defines the material used by a two-dimensional surface. It contains all of the information needed for 起源 to simulate the surface visually, aurally, and physically.
If a material is missing, it will produce the infamous Source pink and black checkered pattern. A white wireframe is not a missing material, but instead a missing shader.
Contents
The contents of a material will fall into some or all of these categories:
A simple example
This is a very basic shingle beach material.
- The
LightmappedGeneric
shader is used, which means that the material is for use on surfaces with lightmaps (i.e. brushes). - The opening curly brace ({) opens a set of parameters
- The
$basetexture
parameter is given withcoast\shingle_01
, which is the location of a texture. This is what will be drawn on the screen. $surfaceprop
gives the material the physical properties of gravel.- The closing curly brace (}) character closes a set of parameters
It's important to remember that this material can only be used on brushes. If it needed to be used on models, for instance, another version would need to be created using the VertexLitGeneric shader.
Most of the time switching materials from one shader to another is as simple as changing their first line, since a great number of parameters are shared between them. Some params only work with certain shaders, like Phong effects, which are only available with VertexLitGeneric, but unfortunately you won't encounter any critical errors if a param isn't understood by the shader. It just won't have any effect.


Finding materials
SteamPipe
When Valve updated all 起源 games to SteamPipe, all materials were moved from GCF into VPK files. Third-party games (running on 起源2004 - 起源2009) that previously used GCF files are also having it's materials moved to depot VPK files. VPK Files work with
GCFScape and
VPKEdit.
More info on SteamPipe here
Non-SteamPipe Games
In non SteamPipe 起源 games, Materials are stored in the
materials\
folder of your game or mod. The best way to browse them is from Hammer's texture selection screen.
If you want to edit or view the code of Valve's material files you will first need to extract them from their GCF package with GCFScape. They tend to be stored in GCFs with 'materials' in their name.