Mesh
Jump to navigation
Jump to search
In Source, the Mesh (sometimes called the body or envelope or skin of the model) defines the deformable 3D geometry of the model's rendered surface. The Rendered Skin is projected over the Mesh which envelopes the Skeleton.
Each model requires at least one mesh (the default mesh) but may also have additional sub-meshes. Each mesh may also have a number of versions optimised for LOD-substitution.
Mesh data is defined in an SMD and compiled to the model's VVD and VTX binaries by StudioMDL. Mesh data includes:
- Geometry data : Vertex Coordinates (relative to a specific Parentbone) for each triangular polygon,
- Smoothing group data : Normal vector (relative to a specific Parentbone) at each vertex,
- Skinning data : UV map coordinates and Default Skinname(s),
- Envelope data : Weight map values and Parentbone for each vertex.

triangles
block of a "Studio Model Data" file.
Default mesh
- The Default mesh is the Mesh that will be rendered unless substituted by a specific LOD mesh, and/or modified by a specific Sub-mesh.
- It is defined in the Reference.smd and compiled to the VVD and VTX binaries via the $body or $model QC command.
Sub-mesh
- Sub-meshes can be switched on and off at runtime. Like the Default mesh, they are enveloped to the model's Skeleton, and will deform (stretch and bend) as if part of the Default mesh. Specific pieces of clothing are good candidates for switchable sub-meshes; eg different types of body armor or headgear. By contrast Sub-models (eg weapons) can be attached to specific $attachment points on this skeleton, but they remain enveloped to their own skeleton; they will move with this skeleton but will not be deform by it.
- The $bodygroup configuration allows any number of sub-meshes (SMDs) to be added to the Default mesh. By setting up multiple $bodygroups sub-mesh switching can be triggered by (code-level) events.
- Sub-meshes do not affect the model's collision model.
- (Todo: $model's face mesh for facial animation ?)
LOD mesh
- Source's LOD system allows a "cheaper" (simplified) version of the Default mesh(es) to be rendered at a distance where the loss of "expensive" detail is not noticeable to the Viewer. Any number of replacement LOD_mesh.SMDs are usually created from pared-down versions of the Default mesh and Sub-Meshes, and compiled via the $lod configuration. The Default mesh or Default Sub-mesh is used when no LOD mesh is active; we could say it amounts to an "lod0" Mesh.