$surfaceprop: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Russian language link)
No edit summary
Line 1: Line 1:
The [[$surfaceprop]] command is used to tell Source what set of properties a surface has. It is found in both [[material]]s and [[Qc|QC]]s.
The '''<code>[[$surfaceprop]]</code>''' command links the surface of either a [[material]] or [[model]] to a set of physical properties, including:
 
The surface prop controls many aspects of simulation:


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


== Syntax ==
== Syntax ==


Syntax is the same in either context:
Syntax is the same for both models and materials:


  $surfaceprop <surface prop>
  $surfaceprop <name>


Surface props are defined in <code>scripts/surfaceproperties_manifest.txt</code> and the files linked to from there. 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]].


== In materials ==
== In materials ==


* <code>$surfaceprop</code> is not a [[shader]] parameter, so can be used on any material at all.
* <code>$surfaceprop</code> is not linked to any particular [[shader]], so can be used at any time.


== In models ==
== In models ==


* A model's surface prop will override its material's
* A model's surface prop will override its material's
* It is unclear whether a model's mass is calculated from it's surface prop 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>


{{otherlang:en}}
{{otherlang:en}}
{{otherlang:en:ru|$surfaceprop:ru}}
{{otherlang:en:ru|$surfaceprop:ru}}
[[Category:QC Commands|S]]
 
[[Category:QC Commands|s]]
[[Category:List of Shader Parameters|S]]
[[Category:List of Shader Parameters|S]]
[[Category:VMT Common]]

Revision as of 07:05, 7 January 2009

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.

In materials

  • $surfaceprop is not linked to any particular shader, so can be used at any time.

In models

  • A model's surface prop will override its material's
  • 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

Template:Otherlang:en Template:Otherlang:en:ru