Studiomodel: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: fixing template case.)
m (Some markup fixes)
Line 1: Line 1:
{{stub}}
{{stub}}
<div style="float:right;padding:0 1em;background:#FFF;">__TOC__</div>


A '''[[Studiomodel]]''' is a fully compiled model that can be loaded into the Source Engine, Hammer, HLMV, etc. Although '''model''' is often used to refer to a ''studiomodel'', it is also frequently used to refer to ''uncompiled'' geometry data contained in an [[SMD]] file or any other [[model editor]] format.  A particular ''Studiomodel'' is usually specified by its ''modelname.mdl'', because the '''MDL''' file acts as an index of the other data files a Studiomodel needs in order to function (ie its MDL, PHY, VVD, VTX ''Geometry'' data and VMT ''Skins'').
A '''[[Studiomodel]]''' is a fully compiled model that can be loaded into the Source Engine, Hammer, HLMV, etc. Although '''model''' is often used to refer to a ''studiomodel'', it is also frequently used to refer to ''uncompiled'' geometry data contained in an [[SMD]] file or any other [[model editor]] format.  A particular ''Studiomodel'' is usually specified by its ''modelname.mdl'', because the '''MDL''' file acts as an index of the other data files a Studiomodel needs in order to function (ie its MDL, PHY, VVD, VTX ''Geometry'' data and VMT ''Skins'').
Line 12: Line 11:


==File Structure==
==File Structure==
({{TODO|#REDIRECT [[MDL]], [[VVD]], [[VTX]], [[PHY]], [[ANI]] to here ?}})
All of a Studiomodel's '''Geometry and Properties Data''' are stored in a number of binary files under <code>game_dir/models/</code>, except '''[[Skin]] Data''' which is stored under <code>game_dir/materials/models/</code> as [[VMT]] and [[VTF]] files. The Binaries are compiled by [[studiomdl|StudioMDL]]. As binaries they are neither editable nor even readable. To decompile a Studiomodel - to its more human-friendly [[SMD]] and [[Qc|QC]] files - point [[mdldecompiler|MdlDecompiler]] or similar at the model's <code>.mdl</code> file. A number of uncompiled model files are provided as illuminating examples in the various subfolders of <code>.../steamapps/<username>/sourcesdk_content/</code>.
All of a Studiomodel's '''Geometry and Properties Data''' are stored in a number of binary files under <code>game_dir/models/</code>, except '''[[Skin]] Data''' which is stored under <code>game_dir/materials/models/</code> as [[VMT]] and [[VTF]] files. The Binaries are compiled by [[studiomdl|StudioMDL]]. As binaries they are neither editable nor even readable. To decompile a Studiomodel - to its more human-friendly [[SMD]] and [[Qc|QC]] files - point [[mdldecompiler|MdlDecompiler]] or similar at the model's <code>.mdl</code> file. A number of uncompiled model files are provided as illuminating examples in the various subfolders of <code>.../steamapps/<username>/sourcesdk_content/</code>.


===MDL===  
=== [[MDL]] ===  
("Model Data Lookup" ;-) The '''''modelname''.mdl''', contains a range of key/index information:
("Model") The '''''modelname''.mdl''', contains a range of key/index information:
* The Studiomodel's Filepath and Filename, used to identify itself and its [[VTX]], [[VVD]], [[PHY]] files to the Game Engine, Hammer, etc.
* The Studiomodel's Filepath and Filename, used to identify itself and its [[VTX]], [[VVD]], [[PHY]] files to the Game Engine, Hammer, etc.
* The name of every ''material'' ([[VMT]]) file this model may use as a [[Skin]] for the Rendering Engine, Hammer Entity Properties, etc.
* The name of every ''material'' ([[VMT]]) file this model may use as a [[Skin]] for the Rendering Engine, Hammer Entity Properties, etc.
Line 28: Line 24:
* etc
* etc


 
=== [[VVD]] ===
===VVD===
("Valve Vertex Data") The '''''modelname''.vvd''' stores position independent flat data for the  
("Valve Vertex Data") The '''''modelname''.vvd''' stores position independent flat data for the  
* Renderable [[Mesh]](es) geometry (note: the skins are in VMT files)
* Renderable [[Mesh]](es) geometry (note: the skins are in VMT files)
Line 40: Line 35:
* Skeletal Animation data ?
* Skeletal Animation data ?


 
=== [[VTX]] ===
===VTX===
("Valve Vertex") is currently found in several flavours: '''''modelname''.sw.vtx''' (Software), '''~.dx80.vtx''' (DirectX 8.0) '''~.dx90.vtx''' (DirectX 9.0) and '''~.xbox.vtx''' (XBox). Each stores Rendering data optimized for that particular GPU pipeline, including
("Valve T...X... ") is currently found in several flavours: '''''modelname''.sw.vtx''' (Software), '''~.dx80.vtx''' (DirectX 8.0) '''~.dx90.vtx''' (DirectX 9.0) and '''~.xbox.vtx''' (XBox). Each stores Rendering data optimized for that particular GPU pipeline, including
* [[wikipedia:Triangle mesh|mesh strip or fan formatted]] Geometry and UV map of each [[LOD]] version of each [[Mesh]].   
* [[wikipedia:Triangle mesh|mesh strip or fan formatted]] Geometry and UV map of each [[LOD]] version of each [[Mesh]].   


 
=== [[PHY]] ===
===PHY===
("Physics") '''''modelname''.phy''' stores the model's (rigid or jointed) collision model data including  
("Physics") '''''modelname''.phy''' stores the model's (rigid or jointed) collision model data including  
* Vertex geometry and Smoothing group data, (no Texturemap used)
* Vertex geometry and Smoothing group data, (no Texturemap used)
Line 53: Line 46:
* all physics prop data except for [[propdata]]?
* all physics prop data except for [[propdata]]?


 
=== [[ANI]] ===
===ANI===
("Animation Library") An optional '''''modelname''.ani''' or '''''modelname''_anim.mdl''' is an Animation Library, containing a whole bunch of sequences for a specific Skeleton. Whilst sequences can be (and are) stored in the main MDL, external libraries are often used either to prevent the main MDL getting too bloated and/or to allow several (similar) models to share a large number of common animations. For example, a simple ''machine model'' like <code>health_charger001.mdl</code> has only two very simple sequences which are stored in the MDL, whereas ''NPC models'' tend to use libraries : <code>npc_headcrab</code> has its own <code>npc_headcrab.ani</code> library, and <code>male_shared.mdl</code> is used by at least 45 separate NPC models.
("Animation Library") An optional '''''modelname''.ani''' or '''''modelname''_anim.mdl''' is an Animation Library, containing a whole bunch of sequences for a specific Skeleton. Whilst sequences can be (and are) stored in the main MDL, external libraries are often used either to prevent the main MDL getting too bloated and/or to allow several (similar) models to share a large number of common animations. For example, a simple ''machine model'' like <code>health_charger001.mdl</code> has only two very simple sequences which are stored in the MDL, whereas ''NPC models'' tend to use libraries : <code>npc_headcrab</code> has its own <code>npc_headcrab.ani</code> library, and <code>male_shared.mdl</code> is used by at least 45 separate NPC models.


 
=== [[VMT]] ===
===VMT===
("Valve Material Type") '''''default_skin''.vmt''' is used to store the Skin's:
("[[Valve Material Type]]") '''''default_skin''.vmt''' is used to store the Skin's:
* [[$surfaceprop]]erties,  
* [[$surfaceprop]]erties,  
* Shader parameters, <!--VertexLitGeneric, $model 1-->
* Shader parameters, <!--VertexLitGeneric, $model 1-->
* and specify the [[colormap]], [[bumpmap]], [[specularmap]], [[luminositymap]] and [[opacitymap]] VTF texture files.
* and specify the [[colormap]], [[bumpmap]], [[specularmap]], [[luminositymap]] and [[opacitymap]] VTF texture files.


[[category:Glossary]]
[[Category:Glossary]]
[[category:Modeling]][[category:Level Design]]
[[Category:Modeling]]
[[Category:Level Design]]

Revision as of 19:44, 3 August 2011

Stub

This article or section is a stub. You can help by expanding it.

A Studiomodel is a fully compiled model that can be loaded into the Source Engine, Hammer, HLMV, etc. Although model is often used to refer to a studiomodel, it is also frequently used to refer to uncompiled geometry data contained in an SMD file or any other model editor format. A particular Studiomodel is usually specified by its modelname.mdl, because the MDL file acts as an index of the other data files a Studiomodel needs in order to function (ie its MDL, PHY, VVD, VTX Geometry data and VMT Skins).

File Structure

All of a Studiomodel's Geometry and Properties Data are stored in a number of binary files under game_dir/models/, except Skin Data which is stored under game_dir/materials/models/ as VMT and VTF files. The Binaries are compiled by StudioMDL. As binaries they are neither editable nor even readable. To decompile a Studiomodel - to its more human-friendly SMD and QC files - point MdlDecompiler or similar at the model's .mdl file. A number of uncompiled model files are provided as illuminating examples in the various subfolders of .../steamapps/<username>/sourcesdk_content/.

MDL

("Model") The modelname.mdl, contains a range of key/index information:

  • The Studiomodel's Filepath and Filename, used to identify itself and its VTX, VVD, PHY files to the Game Engine, Hammer, etc.
  • The name of every material (VMT) file this model may use as a Skin for the Rendering Engine, Hammer Entity Properties, etc.
  • The name of every sound WAV file used by this model, located in ...?
  • The name of every bone, joint and attachment point of this model's Skeleton.
  • The name of every Animation Activity, Sequence, Gesture, Posture or Library used by this model, located in ...?
  • Any $keyvalues such as propdata attributes this model may have, including
    • The name of every Gib.mdl file used by this model, located in ...?
  • etc

VVD

("Valve Vertex Data") The modelname.vvd stores position independent flat data for the

  • Renderable Mesh(es) geometry (note: the skins are in VMT files)
  • Skeletal Animation data ?

VTX

("Valve Vertex") is currently found in several flavours: modelname.sw.vtx (Software), ~.dx80.vtx (DirectX 8.0) ~.dx90.vtx (DirectX 9.0) and ~.xbox.vtx (XBox). Each stores Rendering data optimized for that particular GPU pipeline, including

PHY

("Physics") modelname.phy stores the model's (rigid or jointed) collision model data including

  • Vertex geometry and Smoothing group data, (no Texturemap used)
  • $jointconstraint configuration,
  • $mass, $volume (calculated), etc
  • all physics prop data except for propdata?

ANI

("Animation Library") An optional modelname.ani or modelname_anim.mdl is an Animation Library, containing a whole bunch of sequences for a specific Skeleton. Whilst sequences can be (and are) stored in the main MDL, external libraries are often used either to prevent the main MDL getting too bloated and/or to allow several (similar) models to share a large number of common animations. For example, a simple machine model like health_charger001.mdl has only two very simple sequences which are stored in the MDL, whereas NPC models tend to use libraries : npc_headcrab has its own npc_headcrab.ani library, and male_shared.mdl is used by at least 45 separate NPC models.

VMT

("Valve Material Type") default_skin.vmt is used to store the Skin's: