$treesway: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Revamped with MatParam changes, added that $treeswaystatic is also in CSGO)
(Updated game implementation info; added Mapbase $treeSway implementation)
Line 1: Line 1:
{{screenshot}}
{{screenshot}}
{{Shaderparam|$treesway|since=Left 4 Dead|shader1=VertexLitGeneric}} It morphs a material around using the parameters of an {{ent|env_wind}} entity to give the appearance of tree leaves and foilage blowing in the wind. The subparameters of <code>$treesway</code> determine how much the <code>env_wind</code> entity should affect the morphing, and all of them (except <code>$treeswaystatic</code>) must be specified in order for the effect to work properly. This shader parameter assumes any model using it is facing upwards.
{{Shaderparam|$treesway|since=Left 4 Dead|shader1=VertexLitGeneric}} It morphs a material around using the parameters of an {{ent|env_wind}} entity to give the appearance of tree leaves and foilage blowing in the wind. The subparameters of <code>$treesway</code> determine how much the <code>env_wind</code> entity should affect the morphing, and all of them (except <code>$treeswaystatic</code>) must be specified in order for the effect to work properly. This shader parameter assumes any model using it is facing upwards.
{{note|This shader parameter is also available in {{tf2}}, {{Bms}}, and {{GMOD}}. In {{GMOD}}, it can also be used for {{ent|UnlitGeneric}}.}}
{{note|This shader parameter is also available in {{tf2}}{{Bms}}{{GMOD}}{{mapbase}}. In {{GMOD}}{{mapbase}}, it can also be used for {{ent|UnlitGeneric}}.}}
{{note|This shader is disabled by default in the {{as}} SDK. It can re-enabled by modding.}}
{{note|This shader is disabled by default in the {{as}} SDK. It can re-enabled by modding.}}
{{bug|In {{GMOD}}, using a [[env_projectedtexture|projected texture]] on materials with this parameter will cause flickering. As a workaround, try to keep trees away from where player flashlights can reach. {{ent|$halflambert}} may also partially fix the issue.}}
{{bug|In {{GMOD}}{{mapbase}}, using a [[env_projectedtexture|projected texture]] on materials with this parameter will cause flickering. As a workaround, try to keep trees away from where player flashlights can reach. {{ent|$halflambert}} may also partially fix the issue.}}
: {{todo|What about <code>$singlepassflashlight</code> and <code>$flashlightnolambert</code>?}}
: {{todo|What about <code>$singlepassflashlight</code> and <code>$flashlightnolambert</code>?}}


Line 15: Line 15:
{{MatParam|$treeswaystartheight|float|The height from the model's origin in which the effect starts blending in. Default 0.2.}}
{{MatParam|$treeswaystartheight|float|The height from the model's origin in which the effect starts blending in. Default 0.2.}}
{{MatParam|$treeswayradius|float|The radius from the model's origin in Hammer units in where the effect should start being fully applied. Default 300.}}
{{MatParam|$treeswayradius|float|The radius from the model's origin in Hammer units in where the effect should start being fully applied. Default 300.}}
{{MatParam|$treeswaystartheight|float|The radius from the model's origin in which the effect starts blending in. Default 0.1.}}
{{MatParam|$treeswaystartradius|float|The radius from the model's origin in which the effect starts blending in. Default 0.1.}}
{{MatParam|$treeswayspeed|float|The speed multiplier of large movement such as the trunk. Default 1.}}
{{MatParam|$treeswayspeed|float|The speed multiplier of large movement such as the trunk. Default 1.}}
{{MatParam|$treeswaystrength|float|The distance multiplier of large movement such as the trunk. Default 10.}}
{{MatParam|$treeswaystrength|float|The distance multiplier of large movement such as the trunk. Default 10.}}
Line 26: Line 26:
{{MatParam|$treeswayspeedlerpstart|float|Minimum wind speed in which a gust triggered by <code>env_wind</code> will start affecting the material. Default 3.}}
{{MatParam|$treeswayspeedlerpstart|float|Minimum wind speed in which a gust triggered by <code>env_wind</code> will start affecting the material. Default 3.}}
{{MatParam|$treeswayspeedlerpend|float|Minimum wind speed in which a gust triggered by <code>env_wind</code> will fully affect the material. Default 6.}}
{{MatParam|$treeswayspeedlerpend|float|Minimum wind speed in which a gust triggered by <code>env_wind</code> will fully affect the material. Default 6.}}
{{MatParam|$treeswaystatic|float|Use a static wind value instead of the values from <code>env_wind</code>. If enabled, <code>env_wind</code> is not required.|only={{tf2}}{{csgo}}{{GMOD}}}}
{{MatParam|$treeswaystatic|float|Use a static wind value instead of the values from <code>env_wind</code>. If enabled, <code>env_wind</code> is not required.|only={{tf2}}{{csgo}}{{GMOD}}{{mapbase}}}}
{{MatParam|$treeswaystaticvalues|vector2|Sets the static wind values used by <code>$treeswaystatic</code>, syntax <code>[x y]</code>. Default <code>[0.5 0.5]</code>.|only={{mapbase}}}}


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

Revision as of 10:03, 21 June 2020

Nuvola apps ksnapshot.png
This article or section needs a screenshot to help visually convey the subject.
You can upload screenshots at Special:Upload. For help, see Help:Images.

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 ?]
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