$treesway: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Combine {{bug}})
Line 1: Line 1:
{{langsp}}
{{langsp}}
[[File:de_lake_treesway.gif|thumb|Tree with treesway on {{csgomap|de_lake}} in CS:GO (click on image if GIF is not animated).]]
[[File:de_lake_treesway.gif|thumb|Tree with treesway on {{csgomap|de_lake}} in CS:GO (click to preview).]]
{{Shaderparam|$treesway|since=Left 4 Dead 2|shader1=VertexLitGeneric}} It is also available in {{tf2}}{{Bms}}{{GMOD}}{{mapbase}}. In {{GMOD}}{{mapbase}}, it can also be used for {{ent|UnlitGeneric}}.
{{Shaderparam|$treesway|since=Left 4 Dead 2|shader1=VertexLitGeneric}} It is also available in {{tf2}}{{Bms}}{{GMOD}}{{mapbase}}. In {{GMOD}}{{mapbase}}, it can also be used for {{ent|UnlitGeneric}}.


<code>$treesway</code> 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.
<code>$treesway</code> 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 disabled by default in the {{as}} SDK. It can re-enabled by modding.}}
{{warning|Due to the way bumped lighting is calculated, <code>$treesway</code> will not sway materials which use {{ent|$bumpmap}}.}}
{{warning|Due to the way bumped lighting is calculated, <code>$treesway</code> will not sway materials which use {{ent|$bumpmap}}.}}
{{note|This shader parameter is disabled by default in the {{as}} SDK. It can re-enabled by modding.}}
{{bug|{{clr}}
{{bug|This shader parameter does not work with [[$detail#Parameters and Effects|$detailtexturetransform]].}}
* This shader parameter does not work with [[$detail#Parameters and Effects|$detailtexturetransform]].
{{bug|In {{GMOD}}{{mapbase}}, using a shadow-casting [[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.}}
* In {{GMOD}}{{mapbase}}, using a shadow-casting [[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 {{mapbase}}, using a shadow-casting [[env_projectedtexture|projected texture]] will cause shadows not reacting to <code>$treesway</code>, shadows don't move, expect in {{gmod}}.}}
* In {{mapbase}}, using a shadow-casting [[env_projectedtexture|projected texture]] will cause shadows not reacting to <code>$treesway</code>, shadows don't move, expect in {{gmod}}.
: {{todo|What about <code>$singlepassflashlight</code> and <code>$flashlightnolambert</code>?}}
: {{todo|What about <code>$singlepassflashlight</code> and <code>$flashlightnolambert</code>?}}}}
{{modernImportant|While $TreeSway can be used to animate a {{ent|prop_static}}, lightmap shadows casted by swaying static props will remain static.<br>'''''If [[CSM]] is unavailable''''', consider using a {{ent|prop_dynamic}} instead. This can be combined with an animation containing more realistic pre-baked wind physics than can be achieved with $treesway.<br>As prop_dynamic cannot be lit by [[VRAD]] per-vertex, it may be desirable to use a pre-baked {{ent|$lightmap}} (if available) in such situations, to restore some ambient lighting quality.}}
 
{{modernImportant|While $TreeSway can be used to animate a {{ent|prop_static}}, lightmap shadows casted by swaying static props will remain static.<br>'''''If [[CSM]] is unavailable''''', consider using a {{ent|prop_dynamic}} instead. This can be combined with an animation containing more realistic pre-baked wind physics than can be achieved with $treesway.<br>As {{ent|prop_dynamic}} cannot be lit by [[VRAD]] per-vertex, it may be desirable to use a pre-baked {{ent|$lightmap}} (if available) in such situations, to restore some ambient lighting quality.}}


==Parameters==
==Parameters==

Revision as of 08:00, 19 March 2024

English (en)Русский (ru)Translate (Translate)
Tree with treesway on de_lake de_lake in CS:GO (click to preview).

Template:Shaderparam It is also available in Team Fortress 2Black MesaGarry's ModMapbase. In Garry's ModMapbase, it can also be used for UnlitGeneric.

$treesway 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 disabled by default in the Alien Swarm SDK. It can re-enabled by modding.
Warning.pngWarning:Due to the way bumped lighting is calculated, $treesway will not sway materials which use $bumpmap.
Icon-Bug.pngBug:
  • This shader parameter does not work with $detailtexturetransform.
  • In Garry's ModMapbase, using a shadow-casting 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.
  • In Mapbase, using a shadow-casting projected texture will cause shadows not reacting to $treesway, shadows don't move, expect in Garry's Mod.
Todo: What about $singlepassflashlight and $flashlightnolambert?
  [todo tested in ?]
Icon-Important.pngImportant:While $TreeSway can be used to animate a prop_static, lightmap shadows casted by swaying static props will remain static.
If CSM is unavailable, consider using a prop_dynamic instead. This can be combined with an animation containing more realistic pre-baked wind physics than can be achieved with $treesway.
As prop_dynamic cannot be lit by VRAD per-vertex, it may be desirable to use a pre-baked $lightmap (if available) in such situations, to restore some ambient lighting quality.

Parameters

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

External links

https://gamebanana.com/tuts/12924 - How to achieve a similar effect without $treeSway, on all source engine games. Alternatively, use an animated prop_dynamic, for a more realistic (but more expensive) effect.