$treesway: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (how to achieve [the same effect -> similar effect] in the link)
(Add default values for parameters)
Line 12: Line 12:
//The model is expected to be built lying in the X Y plane in model space, with its center at the origin.
//The model is expected to be built lying in the X Y plane in model space, with its center at the origin.


$treeSwayHeight                  "float"   //The height in which the effect is applied.
$treeSwayHeight                  <float>   //The height in which the effect is applied. Default 1000.
$treeSwayStartHeight              "float"   //The height from the origin in which the effect starts blending in.
$treeSwayStartHeight              <float>   //The height from the origin in which the effect starts blending in. Default 0.2.
$treeSwayRadius                  "float"   //The radius from the origin in which the effect is applied.
$treeSwayRadius                  <float>   //The radius from the origin in which the effect is applied. Default 300.
$treeSwayStartRadius              "float"   //The radius from the origin in which the effect starts blending in.
$treeSwayStartRadius              <float>   //The radius from the origin in which the effect starts blending in. Default 0.1.
$treeSwaySpeed                    "float"   //The speed multiplier of large movement such as the trunk.
$treeSwaySpeed                    <float>   //The speed multiplier of large movement such as the trunk. Default 1.
$treeSwayStrength                "float"   //The distance multiplier of large movement such as the trunk.
$treeSwayStrength                <float>   //The distance multiplier of large movement such as the trunk. Default 10.
$treeSwayScrumbleSpeed            "float"   //The falloff of the effect on small movement such as the trunk. Higher means a more stable center.
$treeSwayScrumbleSpeed            <float>   //The falloff of the effect on small movement such as the trunk. Higher means a more stable center. Default 0.1.


$treeSwayScrumbleStrength        "float"   //The speed multiplier of the small movement such as the leaves.
$treeSwayScrumbleStrength        <float>   //The speed multiplier of the small movement such as the leaves. Default 0.1.
$treeSwayScrumbleFrequency        "float"   //The distance multiplier of the small movement such as the leaves.
$treeSwayScrumbleFrequency        <float>   //The distance multiplier of the small movement such as the leaves. Default 0.1.
$treeSwayFalloffExp              "float"   //The frequency of the rippling of a sine wave in small movement such as the leaves.
$treeSwayFalloffExp              <float>   //The frequency of the rippling of a sine wave in small movement such as the leaves. Default 1.5.
$treeSwayScrumbleFalloffExp      "float"   //The falloff of the effect on small movement such as the leaves. Higher means a more stable center.
$treeSwayScrumbleFalloffExp      <float>   //The falloff of the effect on small movement such as the leaves. Higher means a more stable center. Default 1.


$treeSwaySpeedHighWindMultiplier  "float"   //Speed multiplier when env_wind triggers a gust.
$treeSwaySpeedHighWindMultiplier  <float>   //Speed multiplier when env_wind triggers a gust. Default 2.
$treeSwaySpeedLerpStart          "float"   //Minimum wind speed in which a gust triggered by env_wind will start affecting the material.
$treeSwaySpeedLerpStart          <float>   //Minimum wind speed in which a gust triggered by env_wind will start affecting the material. Default 3.
$treeSwaySpeedLerpEnd            "float"   //Minimum wind speed in which a gust triggered by env_wind will fully affect the material.
$treeSwaySpeedLerpEnd            <float>   //Minimum wind speed in which a gust triggered by env_wind will fully affect the material. Default 6.
$treeSwayStatic                  "boolean"  //Whether or not to instead use a static wind value instead of the values from env_wind. TF2 and GMOD (as of April 2019) only.
$treeSwayStatic                  <bool>    //Whether or not to instead use a static wind value instead of the values from env_wind. TF2 and GMOD (as of April 2019) only.
</pre>
</pre>



Revision as of 19:42, 4 May 2019

$treeSway is a VMT command for VertexLitGeneric available in Left 4 Dead seriesLeft 4 Dead series, Alien Swarm, Portal 2, Counter-Strike: Global Offensive, Insurgency, Team Fortress 2 (As of Jungle Inferno), Black Mesa (as of December 2017), Garry's Mod (as of October 2018) that morphs a material around using the parameters of an env_wind entity. This is used in Counter-Strike: Global Offensive and Insurgency to give the appearance of tree leaves and foilage blowing in the wind. The paramaters of this command determine how much the env_wind entity should affect the morphing. This command assumes any model using it is facing upwards.

Note.pngNote:In Team Fortress 2, Garry's Mod, does not require env_wind if $treeSwayStatic is set to 1.
Note.pngNote:This shader is disabled by default in the Alien Swarm SDK. It can re-enabled by modding.
Icon-Bug.pngBug:In Garry's Mod, using a projected texture on materials with this parameter will cause flickering. As a workaround, try to keep trees away from where player flashlights can reach. $halflambert may also partially fix the issue.  [todo tested in ?]

Parameters

$treeSway                         "0" "1" or "2"
//Changes the treesway effect. 0 is no sway, 1 is classic tree sway, 2 is an alternate, radial tree sway effect.
//Tree sway mode 2: Hacks to use tree sway code on rectangular sheets of plastic/tarp attached at the four corners. 
//Inverts the sway scale radius to be 1 at (0,0,0) in model space and fall off radially towards the edges of the model.
//The model is expected to be built lying in the X Y plane in model space, with its center at the origin.

$treeSwayHeight                   <float>    //The height in which the effect is applied. Default 1000.
$treeSwayStartHeight              <float>    //The height from the origin in which the effect starts blending in. Default 0.2.
$treeSwayRadius                   <float>    //The radius from the origin in which the effect is applied. Default 300.
$treeSwayStartRadius              <float>    //The radius from the origin in which the effect starts blending in. Default 0.1.
$treeSwaySpeed                    <float>    //The speed multiplier of large movement such as the trunk. Default 1.
$treeSwayStrength                 <float>    //The distance multiplier of large movement such as the trunk. Default 10.
$treeSwayScrumbleSpeed            <float>    //The falloff of the effect on small movement such as the trunk. Higher means a more stable center. Default 0.1.

$treeSwayScrumbleStrength         <float>    //The speed multiplier of the small movement such as the leaves. Default 0.1.
$treeSwayScrumbleFrequency        <float>    //The distance multiplier of the small movement such as the leaves. Default 0.1.
$treeSwayFalloffExp               <float>    //The frequency of the rippling of a sine wave in small movement such as the leaves. Default 1.5.
$treeSwayScrumbleFalloffExp       <float>    //The falloff of the effect on small movement such as the leaves. Higher means a more stable center. Default 1.

$treeSwaySpeedHighWindMultiplier  <float>    //Speed multiplier when env_wind triggers a gust. Default 2.
$treeSwaySpeedLerpStart           <float>    //Minimum wind speed in which a gust triggered by env_wind will start affecting the material. Default 3.
$treeSwaySpeedLerpEnd             <float>    //Minimum wind speed in which a gust triggered by env_wind will fully affect the material. Default 6.
$treeSwayStatic                   <bool>     //Whether or not to instead use a static wind value instead of the values from env_wind. TF2 and GMOD (as of April 2019) only.

See Also

https://gamebanana.com/tuts/12924 - How to achieve a similar effect without $treeSway, on all source engine games