$treesway

From Valve Developer Community
Revision as of 05:44, 20 November 2020 by Darnias (talk | contribs) (Added a very super cool gif image and added a warning that $bumpmap breaks it, whoever plays old games please confirm it does it there too)
Jump to navigation Jump to search
Tree with treesway on de_lake in CS:GO (click on image for gif to play).

Template:Shaderparam It morphs a material around using the parameters of an env_wind entity to give the appearance of tree leaves and foilage blowing in the wind. The subparameters of $treesway determine how much the env_wind entity should affect the morphing, and all of them (except $treeswaystatic) must be specified in order for the effect to work properly. This shader parameter assumes any model using it is facing upwards.

Note.pngNote:This shader parameter is also available in Team Fortress 2Black MesaGarry's ModMapbase. In Garry's ModMapbase, it can also be used for UnlitGeneric.
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 ModMapbase, 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 ?]
Warning.pngWarning: In Counter-Strike: Global Offensive it will stop swaying if the material uses $bumpmap.
Todo: Is this Counter-Strike: Global Offensive only limitation?
Todo: What about $singlepassflashlight and $flashlightnolambert?

Parameters

$treesway $treeswayheight $treeswaystartheight $treeswayradius $treeswaystartradius $treeswayspeed $treeswaystrength $treeswayscrumblespeed $treeswayscrumblestrength $treeswayscrumblefrequency $treeswayfalloffexp $treeswayscrumblefalloffexp $treeswayspeedhighwindmultipler $treeswayspeedlerpstart $treeswayspeedlerpend $treeswaystatic $treeswaystaticvalues

See Also

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