$lod
Jump to navigation
Jump to search
Each $lod QC command begins a block of commands describing how to perform LOD (Level of Detail) on the model. Each block specifies a single threshold parameter which represents a distance between the Model and the Viewer. When the Model is rendered beyond this distance that block of LOD commands are executed. The commands allow the LOD system to remove or replace various "expensive" parts of the Model so it can be rendered more efficiently.


- See LOD Models for in-depth information on generating LOD models
- See LOD system for a better overview.
- See also $shadowlod for cheaper Dynamic Shadows.
Syntax
$lod <int|threshhold> { <options> }
where
<int|threshhold>
: The LOD threshhold number is based on an inverse of the screen space. The smaller the model is on-screen, the larger the LOD threshhold will become.

<options>
: See below.
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.
replacematerial <Reference material> <LOD material>
- Replaces all instances of the Reference Material with another. Useful for removing expensive techniques 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 "lod1_Police_reference.smd" replacemodel Manhack_reference "lod1_Manhack_reference.smd" } $lod 18 { replacemodel Police_reference "lod2_Police_reference.smd" replacemodel Manhack_reference "lod2_Manhack_reference.smd" bonetreecollapse ValveBiped.Bip01_R_Hand bonetreecollapse ValveBiped.Bip01_L_Hand } $lod 42 { replacemodel Police_reference "lod3_Police_reference.smd" replacemodel Manhack_reference "lod3_Manhack_reference.smd" bonetreecollapse ValveBiped.Bip01_R_Hand bonetreecollapse ValveBiped.Bip01_L_Hand }