$lod

From Valve Developer Community
Revision as of 15:29, 28 April 2008 by JeffLane (talk | contribs) (minor cleanup and info)
Jump to navigation Jump to search

Begins a block of commands to describe how to perform LOD (Level of Detail) on the model. The distance parameter represents that this particular set of LOD commands should be run when the camera is farther away from the model. The commands allow you to replace various materials, textures, etc. The commands you can include in the lod block are shown below.

Tip.pngTip:The LOD metric is based on an inverse of the screen space. The smaller the model is on-screen, the larger the LOD metric will become. You can use the LOD functions in the Model tab of HLMV to determine the proper metrics for a model.
  • See LOD Models for in-depth information on generating LOD models.

Syntax

$lod <distance1> { <lod commands here> }
$lod <distance2> { <lod commands here> }
  • Each $lod QC command begins a list of commands to perform on the Model when the Player is further than the <distance>(in meters) away from the Model. 1 meter ia approximately 53.333 game units (see Dimensions).
Tip.pngTip: 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
  • The commands allow you to replace various materials, textures, etc.

$lod options

replacemodel (model name) (replacement model) [reverse]
  • Causes the <reference_model_name> to be replaced with the <replacement_model_name>.
  • The <replacement_model_name> should be a lower polygon-count version of the <reference_model_name>.
  • If reverse is specified, the normals of the replacement model are reversed.
  • If the replacement model name is 'blank', then the source model is not rendered at all.
removemodel (model name)
  • Causes the model to not be rendered at this LOD.
replacematerial (original material name) (replacement material name)
  • Replaces all instances of a particular material on a model with the replacement material.
  • This can be used to remove expensive shaders like Normal Maps or the eye shader.
removemesh (material name)
  • Removes all the triangles attached to the named material at this LOD.
nofacial
  • Causes facial animation to be deactivated for this LOD.
replacebone (original bone) (replacement bone)
  • Causes a bone to be used in place of the original bone in the reference model.
  • This can be useful for collapsing all of the bones in the hand together. Instead of using the ‘finger’ bone, the finger could just be tied to the 'hand' bone. See also bonetreecollapse.
bonetreecollapse (bone name)
  • Causes all child bones of the specified bone to use the specified bone instead of whatever they currently are attached to. It's a simpler way to use replacebone in the case where you want to collapse a large number of bones; hands especially can use this feature.