Garry's Mod Wiki

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_ANTLION65Antlions
MAT_BLOODYFLESH66Similar to MAT_FLESH, only used by "bloodyflesh" surface property, has different impact sound
MAT_CONCRETE67Concrete
MAT_DIRT68Dirt
MAT_EGGSHELL69The egg sacs in the antlion tunnels in HL2: EP2
MAT_FLESH70Flesh
MAT_GRATE71Grates, chainlink fences
MAT_ALIENFLESH72Alien flesh - headcrabs and vortigaunts
MAT_CLIP73Unused
MAT_SNOW74Snow
MAT_PLASTIC76Plastic
MAT_METAL77Metal
MAT_SAND78Sand
MAT_FOLIAGE79Plants, only used by the "foliage" surface property
MAT_COMPUTER80Electronics, only used by "computer" surface property
MAT_SLOSH83Water, slime
MAT_TILE84Floor tiles
MAT_GRASS85Grass
MAT_VENT86Metallic vents
MAT_WOOD87Wood
MAT_DEFAULT88Skybox or nodraw texture
MAT_GLASS89Glass
MAT_WARPSHIELD90"wierd-looking jello effect for advisor shield."