$shadowlod

From Valve Developer Community
Revision as of 18:43, 28 April 2008 by JeffLane (talk | contribs) ($shadowlod)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Used to manipulate the shadow geometry for a particular model, to increase shadow rendering performance. Shares a similar syntax and concept with $lod

Syntax

$shadowlod
{
    lod commands
}

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.
removemesh (material name)
  • Removes all the triangles attached to the named material at 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.

Example

$shadowlod
{
	replacemodel "dog_reference" "dog_LOD_shadow"
	bonetreecollapse "dog_model.toe_l"
	bonetreecollapse "dog_model.toe_r" 
	bonetreecollapse "dog_model.eye"
	bonetreecollapse "dog_model.hand_l"
	bonetreecollapse "dog_model.hand_r"
	replacebone "dog_model.spine2" "dog_model.spine1"
	replacebone "dog_model.neck1_length" "dog_model.neck1"
	replacebone "dog_model.neck2_length" "dog_model.neck2"
	replacebone "dog_model.pully_arm_l" "dog_model.arm1_l"
	replacebone "dog_model.tricep1_r" "dog_model.arm1_r"
	replacebone "dog_model.tricep2_r" "dog_model.arm1_r"
	replacebone "dog_model.bicep1_r" "dog_model.arm1_r"
	replacebone "dog_model.bicep2_r" "dog_model.arm1_r"
	replacebone "dog_model.shoulder_plate_r" "dog_model.arm1_r"
	replacebone "dog_model.elbow1_r" "dog_model.arm1_r"
	replacebone "dog_model.elbow1_r1" "dog_model.arm1_r"
	removemesh "models/dog/eyeglass"
}