$lod: Difference between revisions
Jump to navigation
Jump to search
Tip:You don't need to worry about weightmapping LOD models. Studiomdl will transfer from the reference mesh.
Note:You cannot introduce new materials in an LOD SMD. Use
Note:LOD blocks do not inherit from previous blocks. They always modify the reference mesh.
(more cleaning) |
mNo edit summary |
||
Line 3: | Line 3: | ||
The [[$lod]] [[QC command]] describes how to reduce the [[LOD system|level of detail]] on the model at a given distance. It handles the removal or replacement of [[expensive]] parts of the model so it can be rendered more efficiently. It only takes effect on the client. | The [[$lod]] [[QC command]] describes how to reduce the [[LOD system|level of detail]] on the model at a given distance. It handles the removal or replacement of [[expensive]] parts of the model so it can be rendered more efficiently. It only takes effect on the client. | ||
{{tip|You don't need to worry about [[weightmap]]ping LOD models. [[Studiomdl]] will transfer the reference mesh | {{tip|You don't need to worry about [[weightmap]]ping LOD models. [[Studiomdl]] will transfer from the reference mesh.}} | ||
{{note|You cannot introduce new [[material]]s in an LOD SMD. Use <code>replacematerial</code> instead.}} | {{note|You cannot introduce new [[material]]s in an LOD SMD. Use <code>replacematerial</code> instead.}} |
Revision as of 08:17, 18 July 2011
The $lod QC command describes how to reduce the level of detail on the model at a given distance. It handles the removal or replacement of expensive parts of the model so it can be rendered more efficiently. It only takes effect on the client.


replacematerial
instead.See also
Syntax
$lod <threshhold>
{
<options>
}
$shadowlod // Used to generate cheap render-to-texture shadows (not shadow maps)
{
<options>
}
The threshhold
value is based on an inverse of the screen space. The smaller the model is on-screen, the larger the LOD threshhold will become. {{tip|The practical way to achieve a good set of LOD threshholds for your LOD Models is to use the HLMV Model tab to find numbers where the LOD transitions with a low amount of visual popping.
Options

replacemodel <Reference smd> <LOD smd> [reverse]
- Replaces the given reference SMD (can by anything from
$body
,$bodygroup
or$model
) with an LOD version. Reverse
is used to correct reversed normals on the LOD, which can be caused by SMD export problems.removemodel <Reference smd>
- The specified SMD will not be rendered at all at this level of detail.
Bug:Causes compiles to fail in Alien Swarm. [todo tested in ?]
replacematerial <Reference material> <LOD material>
- Replaces all instances of the reference material with another. Useful for removing expensive processes like $bumpmap and disabling the Eye shader. Paths are relative to
$cdmaterials
. removemesh <Reference material>
- Removes all triangles attached to the named material. Unlike in
replacematerial
, paths are relative to the root materials folder. nofacial
- Disables facial animation.
bonetreecollapse <Reference bone>
- Causes children of the specified bone to be removed. Their attached vertices return to the reference position. This is commonly used on fingers. Remember that it only applies to clients!
replacebone <Reference bone> <LOD bone>
- The precursor of
bonetreecollapse
. Replacing bones is much more complex, but allows all kinds of unusual bone optimisations that a simple collapse wouldn't achieve.
Example
$lod 12
{
replacemodel "Police_reference.smd" "lod1_Police_reference.smd"
replacemodel "Manhack_reference.smd" "lod1_Manhack_reference.smd"
}
$lod 18
{
replacemodel "Police_reference.smd" "lod2_Police_reference.smd"
replacemodel "Manhack_reference.smd" "lod2_Manhack_reference.smd"
bonetreecollapse "ValveBiped.Bip01_R_Hand"
bonetreecollapse "ValveBiped.Bip01_L_Hand"
}
$lod 42
{
replacemodel "Police_reference.smd" "lod3_Police_reference.smd"
replacemodel "Manhack_reference.smd" "lod3_Manhack_reference.smd"
bonetreecollapse "ValveBiped.Bip01_R_Hand"
bonetreecollapse "ValveBiped.Bip01_L_Hand"
}