Garry's Mod Wiki

Important Filetypes

Foreword

Creating any sort of model requires you to be familiar with a handful of filetypes specific to source development. This page will attempt to cover all the relevant file types you may encounter, what they do, and how to view / edit them.

Before compilation

.SMD

These are geometry and animation files. These files will be what you need to create in Blender or any other 3D modeling software that can export to this filetype.

There are three "types" of these files:

  • Reference Geometry
  • Physics Geometry
  • Animation Data

The Reference Geometry is the mesh that you will visually see within the game, everything included in this SMD should just be polygons that you want to see in game, and the "reference" skeleton.

The Physics Geometry is the mesh that will be used in the physics engine to calculate all the physics for the model. This is sometimes denoted with terms such as "phys" or "physbox". It will be usually very simplified version of the reference geometry, for performance purposes.

The Animation Data SMD only contains two things within it; enough skeleton data for StudioMdl to match the skeleton to the one in the Reference Geometry, and the actual animation data itself.

See more info about this file format on Valve Developer Community

.QC

These files act as a set of instructions to be used by default StudioMdl.exe compiler in order to determine how the model is "put together".

The QC file will control the final output of your model, things like the model name and location, where the materials will be searched in, what SMD files are your reference geometry and physics, etc.

This file uses commands prefixed with a $ to tell the compiler what information to use for that part of the model.

Here is an example of the most common QC commands:

$modelname "props_sdk\myfirstmodel.mdl" $body mybody "myfirstmodel-ref.smd" $surfaceprop combine_metal $cdmaterials "models\props_sdk" $sequence idle "myfirstmodel-ref.smd" // no animation wanted, so re-using the reference mesh $collisionmodel "myfirstmodel-phys.smd" { $concave }

Don't worry if you don't understand what these specific QC commands do yet, just get familiar with their structure. Understand that every line starts with a QC Command indicated by the $ then is followed by the parameters for the command.

Each command is documented in detail in the Valve Developer Community

See more info about this file format on Valve Developer Community

After Compilation

.MDL

This is your final, compiled, binary model. This is what will be outputted by the StudioMdl program and what will be used in the game.

This file encompasses most of the information needed by the model for use in game. The main MDL file will include animations, the bounding box, hit boxes, material references, meshes, and LOD information.

The below subheadings are secondary files produced when compiling your MDL file. They contain more specialized data.

See more info about this file format on Valve Developer Community

.VVD

This file contains per-vertex data, such as Bone Weights, Normal, Vertices, Tangents and Texture Coordinates all used by the model

See more info about this file format on Valve Developer Community

.VTX

This file has multiple variations (all compiled automatically), which will be chosen by the game automatically based on what APIs the game is using.

For Garry's Mod that runs on DirectX 9.0 the most important variation of these files will be named *.dx90.vtx

These files store hardware optimized material, skinning and triangle strip/fan information for each LOD of the model.

See more info about this file format on Valve Developer Community

.PHY

This file contains the either single (props) or jointed (ragdolls) collision model.

See more info about this file format on Valve Developer Community

.ANI

This file is sometimes created for on-demand loading of animation sequences defined in the QC file with the command $animblocksize. However these are not that common and typically reserved for Source Cinematic Physics not commonly found in Garry's Mod, or for models with a huge list of animations, such as NPCs.

See more info about this file format on Valve Developer Community

Materials

.VTF

This file is a compiled version of an image, also known as a texture. It contains the actual image itself along with any image attributes and the compression information.

See more info about this file format on Valve Developer Community, including what tools can generate these and how.

.VMT

This file can either be created by hand (it's just a text file with a special extension) or by using via 3rd party tools. These are what's known as materials. These files act as the handler for one or more VTF files to provide metadata needed by the source engine for using the material. It includes information about how the material should be rendered, shader parameters, other textures, and misc render settings

See more info about this file format on Valve Developer Community