$lod: Difference between revisions
Jump to navigation
Jump to search
Tip:You can use HLMV's 'Model' tab to preview LODs.
TomEdwards (talk | contribs) No edit summary |
TomEdwards (talk | contribs) m (→Usage) |
||
Line 18: | Line 18: | ||
;<[[int]]|distance> | ;<[[int]]|distance> | ||
:The distance, in metres, from the camera at which the command's options should be performed. | :The distance, in metres, from the camera at which the command's options should be performed. | ||
:{{ | :{{note|LODs are not inherited.}} | ||
:{{tip| When distance from the model doubles, the apparent vertical and horizontal 'resolution' (screen pixels) of the model is halved. Therefore these standard 'double' distances provide a useful benchmark both for modelling and compiling [[LOD Models]]:}} | :{{tip| When distance from the model doubles, the apparent vertical and horizontal 'resolution' (screen pixels) of the model is halved. Therefore these standard 'double' distances provide a useful benchmark both for modelling and compiling [[LOD Models]]:}} | ||
::{| | ::{| |
Revision as of 13:29, 1 May 2008
$lod
is a command that allows a model's reference mesh to be simplified as it becomes smaller on the screen, in order to improve performance. LOD does not affect collision meshes, and is an acronym that stands for Level Of Detail.
With $lod
, you can:
- Reduce the number of bones
- Replace materials
- Hide meshes entirely (if you have more than one
$body
or$model
) - Disable facial animation
See LOD Models for in-depth information on generating LOD models.

Usage
$lod <distance> { <options> }
- <int|distance>
- The distance, in metres, from the camera at which the command's options should be performed.
Note:LODs are not inherited.
Tip: When distance from the model doubles, the apparent vertical and horizontal 'resolution' (screen pixels) of the model is halved. Therefore these standard 'double' distances provide a useful benchmark both for modelling and compiling LOD Models:
Game units: 32 64 128 256 512 1024 2048 4096 8192 Meters: 0.6 1.2 2.4 4.9 9.75 19.5 39.0 78.0 156.0
Options
replacemodel <original $body name> <replacement reference mesh SMD> [reverse]
- Replaces one reference mesh with another of lower detail.
reverse
will cause the new mesh to be reversed.Todo: The point of which is...removemodel <$body name>
- Stops the specified $body from being rendered at all.
removemesh <material name>
- Removes all meshes using the given material.
replacematerial <original material name> <replacement material name>
- Replaces all instances of a particular material on a model. This is used to remove expensive shaders like Normal Maps or the eye shader.
nofacial
- Disables facial animation.
bonetreecollapse <bone>
- 'Welds' all children of the given bone together, disabling animation on the client. The envelopes return to their reference position. Commonly used on fingers.
replacebone <original bone> <replacement bone>
- The precursor of
bonetreecollapse
. Accepting a replacement bone makes it slightly less user-friendly, 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 }