Reference model: Difference between revisions
Jump to navigation
Jump to search
m (→Reference.smd) |
m (→Reference.smd) |
||
Line 26: | Line 26: | ||
* The '''Reference Skin''' is only the ''filename'' of the VMT whose VTFs will be used on the Mesh unless overridden by [[$texturegroup]] skinfamilies options and/or [[$lod]] configuration. | * The '''Reference Skin''' is only the ''filename'' of the VMT whose VTFs will be used on the Mesh unless overridden by [[$texturegroup]] skinfamilies options and/or [[$lod]] configuration. | ||
; Reference Mesh: | |||
* [[ | In Source, the Reference Mesh (also called the ''body'' or ''envelope'' or ''skin'') includes: | ||
* | * [[Geometry]] data : Vertex Coordinates (in relation to the model's [[$origin]]) for each triangular polygon, | ||
* | * [[Smoothing group]] data : Normal vector {{confirm|(in relation to the model's [[$origin]])}} for each vertex, | ||
* [[Skin]] data : [[UV map]] coordinates and Default "Skinname(s)", | |||
* | * [[Envelope]] data : [[Weight map]] values and "Bonename(s)". | ||
< | |||
<!-- | |||
:;Sub-meshes: [[$bodygroup]] allows additional sub-meshes (.smd) to be added to the main [[$body]] mesh. It also allows the model to switch between rendered [[$bodygroup]]s during runtime. Some good candidates for switchable sub-meshes would be different types of body armor or headgear. [[$bodygroup]] sub-meshes are [[enveloped]] to the reference skeleton, and will deform (stretch and bend) as part of the mesh. Sub-meshes are not added to the model's $collisionmodel. ({{todo|[[$model]]'s face mesh for facial animation ?}}) | |||
:;Sub-models: [[$attachment]] points allow world prop models (.mdl), such as the character's "current weapon", to be constrained to a specific bone or bones on the main model. These sub-models will move with the bone they are attached to, but will not deform like the [[$body]] or [[$bodygroup]] meshes. They are essentially prop-constraints for animations rather than part of the main reference model. | |||
;Default Skin: The '''Reference Skin''' is the name of the image file(s) used when creating the [[UV map]] data in the Mesh (the extension - .tga, .bmp, etc - is recorded but not used in compiling). The actual pixel matrices (colors, normals, etc) are not included in the mesh, and are not compiled by StudioMDL. Instead, they must be compiled into [[VTF]] texture files and included in a [[VMT]] material file. By default, the compiled model expects to find a VMT with the same name as the Reference Skin in the <code>game_dir/materials/models</code> directory. If it's not there, the model will be rendered with the "pink check" error material. | |||
:;Alternate Skins: The model can have optional alternate skins, which are also VMT files in the <code>game_dir/materials/models</code> directory. The filenames of optional skins must be specified in the QC file's [[$texturegroup]] configuration in order to be available to the model. The skin to be rendered in game is selected by the level designer {{confirm|and cannot change at runtime}}. An alternate skin can differ from the default skin in many ways, but it cannot change the [[UV map]] data in the model's Mesh. | |||
;Level of Detail Optimisation: Source's [[LOD system]] allows a "cheaper" (simplified) version of the model to be rendered at a distance where the loss of detail is not noticeable to the Viewer. Each [[$lod]] configuration specifies the distance threshhold for a block of modifications. It allows the Rendering Engine (at runtime) to effectively replace or remove Meshes, Skins and/or Bones. Replacement [[LOD Models]] and Skins are created as separate SMDs and VMTs, but they are compiled into the main MDL's [[VVD]] and [[VTX]] files. | |||
--> | |||
[[category:modeling]] | [[category:modeling]] |
Revision as of 09:04, 1 May 2008
Reference.mdl
The Reference.mdl, conventionally named <modelname>.mdl
, contains a range of key information for an in game model:
- The model's Filename, used to identify vital data stored in the model's VTX, VVD, PHY files.
- The names of any Sound WAV files used by this model.
- The names of the Skin VMT files used by this model. (or is this in VTX / VVD files ?)
- The names of any Animation Sequences used by this model.
- The names of any Animation Library MDL files used by this model.
- Any propdata attributes this model may have, including
- The names of any Gib MDL files used by this model.
- etc
Each model's 3D Rendering data is stored in the VVD and VTX files, and its Collisionmodel data in its PHY file.
Reference.smd
The reference.smd is traditionally named "modelname_ref.smd"
to distinguish it from "modelname_anim.smd"
files. It is also distinct from the "modelname_phys.smd"
which contains only collisionmodel reference data.
The reference.smd contains the model's "default" Rendering data for animation files to manipulate.
- The Reference Skeleton (
nodes
block) is used by animations or ragdoll physics to manipulate the mesh, collisionmodel, hitboxset, etc. It can be modified by $lod bonetreecollapse (etc) - The Reference Pose (
skeleton
block) is used when no animation or vphysics is applied to the skeleton. - The Reference Mesh (
triangles
block) is the Mesh that will be Rendered unless replaced by an $lod configuration. - The Reference Skin is only the filename of the VMT whose VTFs will be used on the Mesh unless overridden by $texturegroup skinfamilies options and/or $lod configuration.
- Reference Mesh
In Source, the Reference Mesh (also called the body or envelope or skin) includes:
- Geometry data : Vertex Coordinates (in relation to the model's $origin) for each triangular polygon,
- Smoothing group data : Normal vector for each vertex,
Confirm:(in relation to the model's $origin)
- Skin data : UV map coordinates and Default "Skinname(s)",
- Envelope data : Weight map values and "Bonename(s)".