Func precipitation: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (after the confirm-Template has been on the page for 6 years, I spent the 5 minutes nobody bothered to spend and confirmed that the "Ash" type does indeed work in ep1 and ep2)
Line 47: Line 47:
| <code>1</code> || Snow || Identical to rain, Use "Snowfall" instead.
| <code>1</code> || Snow || Identical to rain, Use "Snowfall" instead.
|-
|-
| <code>2</code> || Ash || Appears with missing textures in most games other than [[Half-Life 2: Episode One|EP1]]. Can be fixed by extracting materials/effects/fleck_ash1 to 3 VMTs and VTFs, and ember_swirling001.vtf from ep1_pak_dir.vpk {{confirm|Works properly in EP1 and [[Half-Life 2: Episode 2|EP2]]?}}
| <code>2</code> || Ash || Appears with missing textures in most games other than [[Half-Life 2: Episode One|EP1]]. Can be fixed by extracting materials/effects/fleck_ash1 to 3 VMTs and VTFs, and ember_swirling001.vtf from ep1_pak_dir.vpk. This issue is fixed in EP1 and onwards.
|-
|-
| <code>3</code> || Snowfall || Snow falling.
| <code>3</code> || Snowfall || Snow falling.

Revision as of 00:46, 29 October 2017

Template:Base brush It creates rain, snow, or ash inside its volume.

Rain Related Console Commands

There are a number of console commands that control func_precipitation rendering.

  • See also Precipitation issues - details various issues and workarounds involving the use of this entity.
Command Name Value Description
r_rainalpha <float> Adjusts transparency of rain particles.
r_rainProfile <bool> Displays stats on rain rendering costs.
r_RainHack <bool> Overrides density values set in Hammer. Enabling will result in longer and more dense rain than at 100%. Can help solve visibility issues.
Note.pngNote:Rain may fall through brushes when this command is enabled.
r_rainspeed <float> Lower values will cause rain to disappear sooner and fall slower. Default value is 600.0f
r_RainSideVel <float> Controls sideways movement of the rain particles.
r_RainSimulate <bool> Toggles animation on the rain; freezes the rain when set to 0.
r_rainwidth <float> Widens the rain's alpha to desired value. Default value is 0.5
r_raindensity <float>
Icon-Bug.pngBug:Appears to have no effect. Deprecated?  [todo tested in ?]
r_RainRadius <float> Distance from the brush where the rain starts/stops rendering.
r_rainalphapow <float>
Icon-Bug.pngBug:Appears to have no effect. Deprecated?   [todo tested in ?]
r_rainlength <float> Changes the length of the rain particles. Default value is 0.1f
r_RainSplashPercentage <float> Percent chance of splash particles spawning when a particle is used.
Todo: The names of these seem descriptive enough for most of them, but what does r_raindensity, and r_rainalphapow do?
Warning.pngWarning:Precipitation volumes shouldn't be placed in the same volume as func_smokevolume is. Otherwise engine may freeze at the end of loading the level. It is probably caused by some particle coding that do not accept this two types of sprites to render at once (in the same volume).

Keyvalues

Density (0-100%) ([todo internal name (i)]) <integer>
This is the amount of particles that fall down from top side of brush. However distance from first particle to second depends on a brush volume size!
Color (R G B) ([todo internal name (i)]) <color255>
Color added to sprites which are rendered transparently (probably rain and snow particles)
Precipitation Type ([todo internal name (i)]) <choices>
Precipitation type
Value Description Description/Notes
0 Rain Rain falling.
1 Snow Identical to rain, Use "Snowfall" instead.
2 Ash Appears with missing textures in most games other than EP1. Can be fixed by extracting materials/effects/fleck_ash1 to 3 VMTs and VTFs, and ember_swirling001.vtf from ep1_pak_dir.vpk. This issue is fixed in EP1 and onwards.
3 Snowfall Snow falling.
4 Particle Rain Template:L4D add Particle rain with refraction. Used in Left 4 Dead's "No Mercy" campaign and CSGO map "de_aztec".
5 Particle Ash Template:L4D add Particle ash with orange tint. Used in Left 4 Dead's "Dead Air" campaign.
6 Particle Rain Storm Template:L4D2 add Particle rain with no refraction, higher density and longer streaks. Used in Left 4 Dead 2's "Hard Rain" and "The Passing" campaigns.
7 Particle Snow Template:CSGO add Particle snowfall. Used in the CSGO map "ar_monastery".
8 Particle Bugs Template:L4D2 add Particle flying bugs. Used in Left 4 Dead 2's "Swamp Fever" campaign.
9 Particle Smoke Template:L4D2 add Particle smoke with view-obscuring density. Used in Left 4 Dead 2's "Dead Center" campaign.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Parentname:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.

Inputs

Alpha
Unlisted input. Changes the density of the rain, and may add additional particle effects like fog or leafs. It accepts inputs from -1 to 255.


Parentname:
SetParent <stringRedirectInput/string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <stringRedirectInput/string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <stringRedirectInput/string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.

Outputs