Func precipitation: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(According to base FGDs in L4D2, AS, CS:GO, etc. and the Alien Swarm SDK, Particle Snow exists as early as Alien Swarm while Particle Bugs/Smoke are exclusive to Left 4 Dead 2.)
(image)
Line 1: Line 1:
{{base brush|func_precipitation}} It creates rain, snow, or ash inside its volume.
{{base brush|func_precipitation}} It creates rain, snow, or ash inside its volume.
 
[[File:Func precipitation rain storm csgo.jpg|thumb|right|Rain particles created by func_precipitation in Counter-Strike: Global Offensive]]
===Rain Related Console Commands===
===Rain Related Console Commands===
There are a number of console commands that control precipitation rendering. See the [[Precipitation issues]] page for details on various issues and workarounds involving this entity.
There are a number of console commands that control precipitation rendering. See the [[Precipitation issues]] page for details on various issues and workarounds involving this entity.

Revision as of 20:59, 15 December 2020

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

Rain particles created by func_precipitation in Counter-Strike: Global Offensive

Rain Related Console Commands

There are a number of console commands that control precipitation rendering. See the Precipitation issues page for details on various issues and workarounds involving this entity.

Command Name Value Description
r_RainParticleDensity Alien SwarmPortal 2 <float> Set the density to enable or disable any precipitation particle. Value 1 to enable and 0 to disable.
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_RainRadius <float> Distance from the brush where the rain starts/stops rendering.
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.
r_raindensity <float> No function. Use r_RainParticleDensity instead.
r_rainalphapow <float> Raises the value of r_rainalpha exponentially.
Confirm:Some say this has no effect?
Warning.pngWarning:func_precipitation brushes should not overlap func_smokevolume brushes, as it can freeze the game. The exact cause of this is not clear.
Note.pngNote:The precipitation created by this entity is not gpu-accelerated. In resource-intensive multiplayer games such as Team Fortress 2, it's recommended to use a particle system to create weather effects rather than relying on this entity.

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 Name Description/Notes Example Map(s)
0 Rain Rain falling. CS:S map "de_aztec".
1 Snow Identical to Rain, use "Snowfall" instead.
2 Ash Ash falling. Appears with missing textures in most games other than EP1. A fix can be applied by extracting all 3 materials/effects/fleck_ash* textures and materials/effects/ember_swirling001 from ep1_pak_dir.vpk. Used throughout EP1.
3 Snowfall Snow falling. DoD:S map "dod_colmar".
4 Particle Rain (in all games since Left 4 Dead) Particle rain with slight mist and refraction. Left 4 Dead's "No Mercy" campaign, CS:GO map "de_aztec".
5 Particle Ash (in all games since Left 4 Dead) Particle ash with orange tint. Left 4 Dead's "Dead Air" campaign.
6 Particle Rain Storm (in all games since Left 4 Dead 2) Particle rain with denser, more angled particles. Left 4 Dead 2's "Hard Rain" and "The Passing" campaigns.
7 Particle Snow (in all games since Alien Swarm) Particle snowfall. CS:GO map "ar_monastery".
7 Particle Bugs (only in Left 4 Dead 2) Particle flying bugs. In later games, this value is used by Particle Snow instead. Left 4 Dead 2's "Swamp Fever" campaign.
8 Particle Smoke (only in Left 4 Dead 2) Particle smoke with variable density. 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