Difference between revisions of "$surfaceprop"

From Valve Developer Community
Jump to: navigation, search
m (In Line 17, $surfaceprop was misspelled)
(clarification)
Line 16: Line 16:
  
 
Names are defined in <code><game>\scripts\surfaceproperties_manifest.txt</code> (and the files it references). For a list of Valve's stock props, see [[Material surface properties]].
 
Names are defined in <code><game>\scripts\surfaceproperties_manifest.txt</code> (and the files it references). For a list of Valve's stock props, see [[Material surface properties]].
 
+
{{bug|[[Left 4 Dead]] does not display bullet decals properly on brick surfaces. If you're okay with the decals and visual effects being inappropriate, you can change the <code>$surfaceprop</code> to something else to fix it.}}
'''NOTE:''' In Left 4 Dead, it appears there is a quirky problem with the '''brick''' material surface property relating to bullet decals. Specifically, Func_breakable brushes using ANY of the brick textures (those supplied in L4D) do not show bullet decals correctly.  In addition, bullet decals on all brick textures, save for urban_brickwall03a, will virtually disappear when they are in light, for example, when you shine the player flashlight on them. This problem also exists in the Valve-created, survival map Last Stand (on the breakable brick wall housing the room where the event is started.)  It is unknown whether this issue will be fixed, or if there are any workarounds using settings currently available. If you're OK with the bullet decals not looking quite right, and various audio and visual effects being inappropriate, you can duplicate and rename the brick texture's vtf and vmt.  Then, open up the vmt and change the material type for its $surface_prop to something like sheetrock or dirt.
 
  
 
== In materials ==
 
== In materials ==
  
* <code>$surfaceprop</code> is not linked to any particular [[shader]], so can be used at any time.
+
* <code>$surfaceprop</code> is not linked to any particular [[shader]], so it can be used at any time.
* Only brush based shaders required this parameter. A common misconception is that this parameter is required within the materials used by models. It will simply be ignored by the shader and is not required. $surfaceprop must always be defined within the collision property of the QC file if anything other than the default is to be used.
+
* Only brush based shaders require this parameter. <code>$surfaceprop</code> must always be defined within the collision property of the QC file if anything other than the default is to be used, however.
  
 
== In models ==
 
== In models ==

Revision as of 16:15, 4 March 2014

Русский

The $surfaceprop command links the surface of either a material or model to a set of physical properties, including:

  • What sounds are emitted during collisions
  • What effects are emitted when the surface is shot
  • Mass, buoyancy, bounciness...
  • The effect of the surface on nearby sounds (reverberation, echo, absorption...)

Syntax

Syntax is the same for both models and materials:

$surfaceprop <name>

Names are defined in <game>\scripts\surfaceproperties_manifest.txt (and the files it references). For a list of Valve's stock props, see Material surface properties.

Bug: Left 4 Dead does not display bullet decals properly on brick surfaces. If you're okay with the decals and visual effects being inappropriate, you can change the $surfaceprop to something else to fix it.

In materials

  • $surfaceprop is not linked to any particular shader, so it can be used at any time.
  • Only brush based shaders require this parameter. $surfaceprop must always be defined within the collision property of the QC file if anything other than the default is to be used, however.

In models

  • It is unclear whether a model's mass is calculated from $surfaceprop or prop_data
  • Surface props can be defined for individual bones with $jointsurfaceprop