$lod: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(cleanup)
Line 1: Line 1:
$lod (distance) { (lod commands here) }
See [[LOD Models]] for a great introduction to the whys and wherefores of these curious critters.
* Begins a block of commands to describe how to perform LOD on the model. The distance parameter represents that this particular set of LOD commands should be run when the camera is farther than distance away from the model. The commands allow you to replace various materials, textures, etc.  


=== Level of Detail commands you can include in the LOD block: ===
==QC 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| 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. See also [[LOD Models]] for a good introduction to using the parameters.


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.


bonetreecollapse (bone name)
=== $lod commands ===
* 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.


  replacemodel (model name) (replacement model) [reverse]
  replacemodel <reference_model_name> <replacement_model_name> [reverse]
* Causes the source model to be replaced with a different model. 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. This is used to replace the model with lower polygon-count versions.  
* 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>. See [[LOD Models]]
* If '''reverse''' is specified, the normals of the replacement model are reversed.  
* {{todo|confirm: If a <replacement_model_name> is not specified, the <reference_model_name> is not rendered either.}}


  removemodel (model name)
  removemodel <reference_model_name>
* Causes the model to not be rendered at this LOD.  
* Causes the model to not be rendered at this $lod distance.  


  replacematerial (original material name) (replacement material name)
  replacematerial <original_material_name> <replacement_material_name>
* Replaces all instances of a particular material on a model with a different material. This can be used to remove expensive shaders like Normal Maps or the eye shader.  
* 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)
  removemesh <material_name>
* Removes all the triangles attached to the named material from this LOD.  
* Removes all the triangles attached to the named material from this $lod distance.  


  nofacial  
  nofacial  
* Causes facial animation to be deactivated for this LOD.   
* Causes facial animation to be deactivated for this $lod distance.   
 
replacebone <original_bone_name> <replacement_bone_name>
* 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 <code>bonetreecollapse</code>.
 
bonetreecollapse <parent_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.




[[Category:QC Commands]]
[[Category:QC Commands]]

Revision as of 07:14, 10 April 2008

See LOD Models for a great introduction to the whys and wherefores of these curious critters.

QC 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. See also LOD Models for a good introduction to using the parameters.


$lod commands

replacemodel <reference_model_name> <replacement_model_name> [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>. See LOD Models
  • If reverse is specified, the normals of the replacement model are reversed.
  • Todo: confirm: If a <replacement_model_name> is not specified, the <reference_model_name> is not rendered either.
removemodel <reference_model_name>
  • Causes the model to not be rendered at this $lod distance.
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 from this $lod distance.
nofacial 
  • Causes facial animation to be deactivated for this $lod distance.
replacebone <original_bone_name> <replacement_bone_name>
  • 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 <parent_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.