MAT
Description
Enumerations used in TraceResult structure and SurfacePropertyData structure, and by Entity:GetMaterialType.
These aren't VMT materials!
Material types are a holdover from GoldSrc and Quake before it. They were previously used to classify textures and entities into categories, defining their physical properties. In practice, this really only changed impact sounds and effects, and player footstep sounds. For example, func_breakable (in GoldSrc) used it to select which gibs to spawn when broken. Raw texture files were given these properties by assigning them to a material. These were tracked in the single file materials.txt, which contained mappings of material types to texture names. Materials are indexed using a letter—for example MAT_METAL was indexed in materials.txt with the letter "M". The value of MAT_METAL is 77, because the ASCII value for M is 77. Some entities could also be assigned materials directly in their keyvalues using the same system.
In Source, materials were moved out of the single materials.txt file; now every texture has its own associated material file, called VMT (Valve Material Type). VMTs contain all the information legacy materials used to provide and more, including including shader, transparency, physical properties, animations...
Rather than place the properties directly inside the VMT (which would prevent them from being assigned directly to entities like legacy materials could), surface properties were added, which can be selected in the VMT using the $surfaceprop key. Surface properties are what determine impact sounds, buoyancy, friction, and other such properties. These do not use letters as identifiers and instead use string names. You can view the surface properties Garry's Mod loads by looking in the GarrysMod/sourceengine/scripts/surfaceproperties.txt file.
However, legacy materials still exist in Source. They are called game materials or material types to separate them from the new material system where confusion between the two is a concern. For example, surface property definitions contain a gamematerial parameter; this field assigns a legacy game material to a surface property, which is then assigned to VMTs and entities.
The main thing legacy game materials are used for nowadays are picking impact effects and decals, like in GoldSrc. Otherwise, surface properties and VMTs replace most other functionality.
Values
| MAT_ANTLION | 65 | Antlions |
| MAT_BLOODYFLESH | 66 | Similar to MAT_FLESH, only used by "bloodyflesh" surface property, has different impact sound |
| MAT_CONCRETE | 67 | Concrete |
| MAT_DIRT | 68 | Dirt |
| MAT_EGGSHELL | 69 | The egg sacs in the antlion tunnels in HL2: EP2 |
| MAT_FLESH | 70 | Flesh |
| MAT_GRATE | 71 | Grates, chainlink fences |
| MAT_ALIENFLESH | 72 | Alien flesh - headcrabs and vortigaunts |
| MAT_CLIP | 73 | Unused |
| MAT_SNOW | 74 | Snow |
| MAT_PLASTIC | 76 | Plastic |
| MAT_METAL | 77 | Metal |
| MAT_SAND | 78 | Sand |
| MAT_FOLIAGE | 79 | Plants, only used by the "foliage" surface property |
| MAT_COMPUTER | 80 | Electronics, only used by "computer" surface property |
| MAT_SLOSH | 83 | Water, slime |
| MAT_TILE | 84 | Floor tiles |
| MAT_GRASS | 85 | Grass |
| MAT_VENT | 86 | Metallic vents |
| MAT_WOOD | 87 | Wood |
| MAT_DEFAULT | 88 | Skybox or nodraw texture |
| MAT_GLASS | 89 | Glass |
| MAT_WARPSHIELD | 90 | "wierd-looking jello effect for advisor shield." |
Garry's Mod
Rust
Steamworks
Wiki Help