$treesway: Difference between revisions
Deprecated (talk | contribs) (Add default values for parameters) |
Deprecated (talk | contribs) ($treesway rewrite) |
||
Line 1: | Line 1: | ||
{{screenshot}} | |||
{{note| | {{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 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. | {{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.}} | ||
: {{todo|What about <code>$singlepassflashlight</code> and <code>$flashlightnolambert</code>?}} | |||
==Parameters== | ==Parameters== | ||
$ | {{MatParam|$treesway|int|What option to use for the tree swaying effect. | ||
$ | :*0: No Sway | ||
$ | :*1: "Classic" tree sway. | ||
$ | :*2: Radial tree sway effect, intended for use on rectangular sheets of plastic/tarp attached at four corners. It inverts the sway scale radius to be 1 at (0,0,0) in model space and to fall off radially towards the edges of the model. {{note|Models using <code>$treesway 2</code> are expected to be built lying in the X Y plane in model space, with their center at the origin.}}}} | ||
$ | {{MatParam|$treeswayheight|float|The starting height in Hammer units where the effect should start being fully applied. Default 1000.}} | ||
$ | {{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|$treeswaystartheight|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|$treeswaystrength|float|The distance multiplier of large movement such as the trunk. Default 10.}} | ||
$ | {{MatParam|$treeswayscrumblespeed|float|The falloff of the effect on large movement such as the trunk. Higher means a more stable center. Default 0.1.}} | ||
$ | {{MatParam|$treeswayscrumblestrength|float|The speed multiplier of the small movement such as the leaves. Default 0.1.}} | ||
{{MatParam|$treeswayscrumblefrequency|float|The distance multiplier of the small movement such as the leaves. Default 0.1.}} | |||
$ | {{MatParam|$treeswayfalloffexp|float|The frequency of the rippling of a sine wave in small movement such as the leaves. Default 1.5.}} | ||
$ | {{MatParam|$treeswayscrumblefalloffexp|float|The falloff of the effect on small movement such as the leaves. Higher means a more stable center. Default 1.}} | ||
$ | {{MatParam|$treeswayspeedhighwindmultipler|float|Speed multiplier when <code>env_wind</code> triggers a gust. Default 2.}} | ||
$ | {{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|$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|also=GMOD}} | |||
[[Category:List of Shader Parameters|T]] | [[Category:List of Shader Parameters|T]] |
Revision as of 18:23, 17 November 2019

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.







- Todo: What about
$singlepassflashlight
and$flashlightnolambert
?
Parameters
$treesway
$treeswayheight
$treeswaystartheight
$treeswayradius
$treeswaystartheight
$treeswayspeed
$treeswaystrength
$treeswayscrumblespeed
$treeswayscrumblestrength
$treeswayscrumblefrequency
$treeswayfalloffexp
$treeswayscrumblefalloffexp
$treeswayspeedhighwindmultipler
$treeswayspeedlerpstart
$treeswayspeedlerpend
$treeswaystatic
See Also
https://gamebanana.com/tuts/12924 - How to achieve a similar effect without $treeSway
, on all source engine games