$treesway: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added $treeSwayStatic, and did a few minor changes.)
(shortened the double length links, merged the syntax and parameter sections into one)
Line 1: Line 1:
When this parameter is added, it will make the material morph around to an [[env_wind]] entity to give it the effect that it's blowing in the wind, this effect is used for the trees you see in {{csgo}}[[Counter-Strike:_Global_Offensive|Counter-Strike: Global Offensive]] and various foliage seen in  {{insurgency}}[http://store.steampowered.com/app/222880 Insurgency 2014]. The effect assumes that the model is facing upwards, and the commands specify how much it should be affected by the [[env_wind]] entity.  This shader has possibly been in Valve games since [[Left_4_Dead|Left 4 Dead]], but was never enabled and used by Valve until [[Left_4_Dead_2|Left 4 Dead 2]], mods using the [[Alien_Swarm|Alien Swarm]] codebase can enable this shader to take advantage of it.
When this parameter is added, it will make the material morph around to an {{ent|env_wind}} entity to give it the effect that it's blowing in the wind, this effect is used for the trees you see in {{csgo}}[[Counter-Strike: Global Offensive]] and various foliage seen in  {{insurgency}}[[Insurgency]]. The effect assumes that the model is facing upwards, and the commands specify how much it should be affected by the <code>env_wind</code> entity.  This parameter has possibly been in Valve games since [[Left 4 Dead]], but was used until [[Left 4 Dead 2]]. Mods using the [[Alien Swarm]] codebase can enable this shader to take advantage of it.


{{note|These parameters only work in recent engine branches like {{l4d2}}, {{csgo}} and other games based on it like {{insurgency}}, along with mods that have it enabled like [http://store.steampowered.com/app/270370 Lambda Wars]. It was recently added to [[Team_Fortress_2|Team Fortress 2]] with the Jungle Inferno Update and does not require [[env_wind]] to function.}}
{{note|This was recently added to [[Team Fortress 2]] with the Jungle Inferno Update and does not require <code>env_wind</code> to function.}}


Requires <code>[[VertexLitGeneric]]</code>.
Requires {{ent|VertexLitGeneric}}.
 
==Syntax==
 
    $treeSway                        "1"
    $treeSwayHeight                  "8"
    $treeSwayStartHeight              ".5"
    $treeSwayRadius                  "1"
    $treeSwayStartRadius              "0.0"
    $treeSwaySpeed                    "2"
    $treeSwayStrength                ".1"
    $treeSwayScrumbleSpeed            "3"
    $treeSwayScrumbleStrength        ".2"
    $treeSwayScrumbleFrequency        "20"
    $treeSwayFalloffExp              "2"
    $treeSwayScrumbleFalloffExp      "3"
    $treeSwaySpeedHighWindMultiplier  ".2"
    $treeSwaySpeedLerpStart          "1000.0"
    $treeSwaySpeedLerpEnd            "2500.0"
 
==Additional parameters==
 
; {{KV|$treeSway|float|Turns the effect on or off.}}
 
; {{KV|$treeSwayHeight|float|The height in which the effect is applied.}}
 
; {{KV|$treeSwayStartHeight|float|The height from the origin in which the effect starts blending in.}}
 
; {{KV|$treeSwayRadius|float|The radius from the origin in which the effect is applied.}}
 
; {{KV|$treeSwayStartRadius|float|The radius from the origin in which the effect starts blending in.}}
 
; {{KV|$treeSwaySpeed|float|The speed multiplier of large movement such as the trunk.}}
 
; {{KV|$treeSwayStrength|float|The distance multiplier of large movement such as the trunk.}}
 
; {{KV|$treeSwayFalloffExp|float|The falloff of the effect on small movement such as the trunk. Higher means a more stable center.}}
 
; {{KV|$treeSwayScrumbleSpeed|float|The speed multiplier of the small movement such as the leaves.}}
 
; {{KV|$treeSwayScrumbleStrength|float|The distance multiplier of the small movement such as the leaves.}}
 
; {{KV|$treeSwayScrumbleFrequency|float|The frequency of the rippling of a sine wave in small movement such as the leaves.}}
 
; {{KV|$treeSwayScrumbleFalloffExp|float|The falloff of the effect on small movement such as the leaves. Higher means a more stable center.}}
 
; {{KV|$treeSwaySpeedHighWindMultiplier|float|Speed multiplier when [[env_wind]] triggers a gust.}}
 
; {{KV|$treeSwaySpeedLerpStart|float|Minimum wind speed in which a gust triggered by [[env_wind]] will start affecting the material.}}
 
; {{KV|$treeSwaySpeedLerpEnd|float|Minimum wind speed in which a gust triggered by [[env_wind]] will fully affect the material.}}
 
; {{TF2 add|{{KV|$treeSwayStatic|bool|Whether or not to instead use a static wind value instead of the values from [[env_wind]].}}}}


==Parameters==
<pre>
$treeSway                        "1" //Turns the effect on or off.
$treeSwayHeight                  "float"//The height in which the effect is applied.
$treeSwayStartHeight              "float"//The height from the origin in which the effect starts blending in.
$treeSwayRadius                  "float"//The radius from the origin in which the effect is applied.
$treeSwayStartRadius              "float"//The radius from the origin in which the effect starts blending in.
$treeSwaySpeed                    "float"//The speed multiplier of large movement such as the trunk.
$treeSwayStrength                "float"//The distance multiplier of large movement such as the trunk.
$treeSwayScrumbleSpeed            "float"//The falloff of the effect on small movement such as the trunk. Higher means a more stable center.
$treeSwayScrumbleStrength        "float"//The speed multiplier of the small movement such as the leaves.
$treeSwayScrumbleFrequency        "float"//The distance multiplier of the small movement such as the leaves.
$treeSwayFalloffExp              "float"//The frequency of the rippling of a sine wave in small movement such as the leaves.
$treeSwayScrumbleFalloffExp      "float"//The falloff of the effect on small movement such as the leaves. Higher means a more stable center.
$treeSwaySpeedHighWindMultiplier  "float"//Speed multiplier when env_wind triggers a gust.
$treeSwaySpeedLerpStart          "float"//Minimum wind speed in which a gust triggered by env_wind will start affecting the material.
$treeSwaySpeedLerpEnd            "float"//Minimum wind speed in which a gust triggered by env_wind will fully affect the material.
$treeSwayStatic                  "1" //Whether or not to instead use a static wind value instead of the values from env_wind.
</pre>


[[Category:List of Shader Parameters|T]]
[[Category:List of Shader Parameters|T]]

Revision as of 21:58, 27 June 2018

When this parameter is added, it will make the material morph around to an env_wind entity to give it the effect that it's blowing in the wind, this effect is used for the trees you see in Counter-Strike: Global OffensiveCounter-Strike: Global Offensive and various foliage seen in InsurgencyInsurgency. The effect assumes that the model is facing upwards, and the commands specify how much it should be affected by the env_wind entity. This parameter has possibly been in Valve games since Left 4 Dead, but was used until Left 4 Dead 2. Mods using the Alien Swarm codebase can enable this shader to take advantage of it.

Note.pngNote:This was recently added to Team Fortress 2 with the Jungle Inferno Update and does not require env_wind to function.

Requires VertexLitGeneric.

Parameters

$treeSway                         "1" //Turns the effect on or off.
$treeSwayHeight                   "float"//The height in which the effect is applied.
$treeSwayStartHeight              "float"//The height from the origin in which the effect starts blending in.
$treeSwayRadius                   "float"//The radius from the origin in which the effect is applied.
$treeSwayStartRadius              "float"//The radius from the origin in which the effect starts blending in.
$treeSwaySpeed                    "float"//The speed multiplier of large movement such as the trunk.
$treeSwayStrength                 "float"//The distance multiplier of large movement such as the trunk.
$treeSwayScrumbleSpeed            "float"//The falloff of the effect on small movement such as the trunk. Higher means a more stable center.
$treeSwayScrumbleStrength         "float"//The speed multiplier of the small movement such as the leaves.
$treeSwayScrumbleFrequency        "float"//The distance multiplier of the small movement such as the leaves.
$treeSwayFalloffExp               "float"//The frequency of the rippling of a sine wave in small movement such as the leaves.
$treeSwayScrumbleFalloffExp       "float"//The falloff of the effect on small movement such as the leaves. Higher means a more stable center.
$treeSwaySpeedHighWindMultiplier  "float"//Speed multiplier when env_wind triggers a gust.
$treeSwaySpeedLerpStart           "float"//Minimum wind speed in which a gust triggered by env_wind will start affecting the material.
$treeSwaySpeedLerpEnd             "float"//Minimum wind speed in which a gust triggered by env_wind will fully affect the material.
$treeSwayStatic                   "1" //Whether or not to instead use a static wind value instead of the values from env_wind.