$surfaceprop: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (fixed that see also section, spelling isn't a common asset anymore i guess)
m (updated language bar. also some formatting.)
Line 1: Line 1:
{{otherlang2
{{lang|$surfaceprop|$title=$surfaceprop}}
|ru=$surfaceprop:ru
|ko=$surfaceprop:ko
}}


The '''<code>[[$surfaceprop]]</code>''' command links the surface of either a [[material]] or [[model]] to a set of physical properties, including:
The {{ent|$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 sounds are emitted during collisions
Line 18: Line 15:


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.}}
{{bug|{{l4d|4}} 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.}}


== In materials ==
== In Materials ==


* <code>$surfaceprop</code> is not linked to any particular [[shader]], so it 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 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.
* 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 ==


* It is unclear whether a model's mass is calculated from <code>$surfaceprop</code> or <code>[[Prop Data|prop_data]]</code>
* It is unclear whether a model's mass is calculated from <code>$surfaceprop</code> or <code>[[Prop Data|prop_data]]</code>.
* Surface props can be defined for individual [[bone]]s with <code>[[$jointsurfaceprop]]</code>
* Surface props can be defined for individual [[bone]]s with <code>[[$jointsurfaceprop]]</code>.


== See Also ==
== See Also ==

Revision as of 14:43, 30 April 2022

English (en)한국어 (ko)Русский (ru)Translate (Translate)

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.

Icon-Bug.pngBug:Left 4 Dead 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.  [todo tested in ?]

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.

See Also