$surfaceprop: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{stub}}
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 [[$surfaceprop]] is used to apply a set of surface-collision effects to a Model (as a [[QC command]]) or a Brush Material (as a [[VMT command]]).  
* The basic principle is the same in both cases; the $surfaceprop affects :
:* what sounds it makes when it collides,
:* what particles it emits when shot,
:* what decals it acquires when shot, etc
<!--:* what gibs it throws up if it breaks. // surely this is defined only by propdata or $collisiontext? -->
:* the object's density for physics calculations such as [[$automass]], <!-- confirm this is derived from $surfaceprop and not propdata ? -->


* [[HLMV]] can be used to generate blocks of .QC file that sets the surface properties correctly.
The surface prop controls many aspects of simulation:
* If no $surfaceprop is defined, the "default" surfaceprop (which is something like concrete) is used.
* See also [[$jointsurfaceprop]].
* See also [[propdata]].


==Example Syntax==
* What sounds are emitted during collisions
$surfaceprop "<surfaceproperty_name>"
* What effects are emitted when the surface is shot
where
* The surface's mass, buoyancy, bounciness...
; <surfaceproperty_name>
* The effect of the surface on nearby sounds (reverberation, echo, absorption...)
: is a ''brush'' surface property defined in the <code>/scripts/surfaceproperties.txt</code> file (see [[Material Surface Property]]),
: or a ''model'' surface property defined in the <code>/scripts/surfaceproperties_hl2.txt</code> file.


== Syntax ==


Syntax is the same in either context:
$surfaceprop <surface prop>
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]].
== In materials ==
* <code>$surfaceprop</code> is not a [[shader]] parameter, so can be used on any material at all.
== In models ==
* 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>
* Surface props can be defined for individual [[bone]]s with <code>[[$jointsurfaceprop]]</code>


[[Category:QC Commands|S]]
[[Category:QC Commands|S]]
[[Category:List of Shader Parameters]]
[[Category:List of Shader Parameters|S]]
[[Category:VMT Common]]
[[Category:VMT Common]]

Revision as of 03:04, 13 July 2008

The $surfaceprop command is used to tell Source what set of properties a surface has. It is found in both materials and QCs.

The surface prop controls many aspects of simulation:

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

Syntax

Syntax is the same in either context:

$surfaceprop <surface prop>

Surface props are defined in scripts/surfaceproperties_manifest.txt and the files linked to from there. For a list of Valve's stock props, see Material surface properties.

In materials

  • $surfaceprop is not a shader parameter, so can be used on any material at all.

In models

  • 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 prop_data
  • Surface props can be defined for individual bones with $jointsurfaceprop