This article's documentation is for anything that uses the Source engine. Click here for more information.

Func precipitation: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.)
(→‎Keyvalues: swapped list with nicer looking table.)
Line 9: Line 9:
{{KV|Color (R G B)|intn=rendercolor|color255|Color added to sprites which are rendered transparently (probably rain and snow particles)}}
{{KV|Color (R G B)|intn=rendercolor|color255|Color added to sprites which are rendered transparently (probably rain and snow particles)}}
{{KV|Precipitation Type|intn=preciptype|choices|Precipitation type}}
{{KV|Precipitation Type|intn=preciptype|choices|Precipitation type}}
{{ColumnBox|count=1|margin=2em|
{{Table
*0: Rain. Rain falling. '''Example:''' [[Counter-Strike: Source|CS:S]] map "<code>de_aztec</code>"
| {{tr
*1: Snow. Identical to Rain, use "Snowfall" instead
| {{th| Type }} {{th| Availability}} {{th| Description }}
*2: Ash. Ash falling. Appears with missing textures in most games other than {{hl2ep1|4.1}}. A fix can be applied by extracting all 3 <code>materials/effects/fleck_ash*</code> textures and <code>materials/effects/ember_swirling001</code> from <code>ep1_pak_dir.vpk</code>. '''Example:''' Used throughout [[Half-Life 2: Episode One|EP1]]
}}
*3: Snowfall. Snow falling. '''Example:''' [[Day of Defeat: Source|DoD:S]] map "<code>dod_colmar</code>".
{{tr
*4: Particle Rain. {{since|{{l4d}}}} Particle rain with slight mist and refraction. '''Examples:''' [[Left 4 Dead|Left 4 Dead's]] "No Mercy" campaign, [[Counter-Strike: Global Offensive|CS:GO]] map "<code>de_aztec</code>"
| {{td|Rain|dark=1}}
*5: Particle Ash. {{since|{{l4d}}}} Particle ash. '''Example:''' Left 4 Dead's "Dead Air" campaign.
{{td| }}
*6: Particle Rain Storm. {{since|{{l4d2}}}} Particle rain with no mist/refraction and more angled particles. Alpha values over 100 enable an additional flying leaves effect seen during the storm event. '''Example:''' [[Left 4 Dead 2|Left 4 Dead 2's]] "Hard Rain" and "The Passing" campaigns.
{{td|Seen in [[Counter-Strike: Source|CS:S]] map "<code>de_aztec</code>"}}
*7: Particle Snow. {{since|{{as}}}} Particle snowfall. '''Example:''' CS:GO map "<code>ar_monastery</code>"
}}
*7: Particle Bugs. {{only|{{l4d2}}}} Particle flying bugs. In later games, this value is used by Particle Snow instead. '''Example:''' Left 4 Dead 2's "Swamp Fever" campaign.
{{tr
*8: Particle Smoke. {{only|{{l4d2}}}} Particle smoke with variable density. '''Example:''' Left 4 Dead 2's "Dead Center" campaign.
| {{td|Snow|dark=1}}
{{td| }}
{{td|Identical to Rain, use "Snowfall" instead. }}
}}
{{tr
| {{td|Ash|dark=1}}
{{td| }}
{{td|Seen throughout [[Half-Life 2: Episode One]]
{{note|Appears with missing textures in most games. You may copy all <code>materials/effects/fleck_ash*</code> and <code>materials/effects/ember_swirling001</code> files from <code>ep1_pak_dir.vpk</code> and ship it with your game/map.}} }}
}}
{{tr
| {{td|Snowfall|dark=1}}
{{td| }}
{{td|Seen in [[Day of Defeat: Source|DoD:S]] map "<code>dod_colmar</code>" }}
}}
{{tr
| {{td|Particle Rain|dark=1}}
{{td|{{since|{{l4d}}}} }}
{{td|Seen in [[Left 4 Dead|Left 4 Dead's]] "No Mercy" campaign, [[Counter-Strike: Global Offensive|CS:GO]] map "<code>de_aztec</code>"<br>
Particle rain with slight mist and refraction. }}
}}
{{tr
| {{td|Particle Ash|dark=1}}
{{td|{{since|{{l4d}}}} }}
{{td|Seen in in Left 4 Dead's "Dead Air" campaign. }}
}}
{{tr
| {{td|Particle Rain Storm |dark=1}}
{{td|{{since|{{l4d2}}}} }}
{{td|Seen in [[Left 4 Dead 2|Left 4 Dead 2's]] "Hard Rain" and "The Passing" campaigns.<br>
Particle rain with no mist/refraction and more angled particles. Alpha values over 100 enable an additional flying leaves effect seen during the storm event. }}
}}
{{tr
| {{td|Particle Snow|dark=1}}
{{td|{{since|{{as}}}} }}
{{td|Seen in CS:GO map "<code>ar_monastery</code>" }}
}}
{{tr
| {{td|Particle Bugs|dark=1}}
{{td|{{only|{{l4d2}}}} }}
{{td|Seen in Left 4 Dead 2's "Swamp Fever" campaign.<br>
Particle flying bugs. In later games, this value is used by Particle Snow instead. }}
}}
{{tr
| {{td|Particle Smoke|dark=1}}
{{td|{{only|{{l4d2}}}} }}
{{td|Seen in Left 4 Dead 2's "Dead Center" campaign.<br>
Particle smoke with variable density.  }}
}}
}}
}}
{{note|The "Particle" precipitation types are generated using the PCF files of a game, allowing users to alter the look of the precipitation in more ways than just the used material.}}


== Inputs ==
== Inputs ==

Revision as of 05:54, 9 July 2024

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

func_precipitation is a brush entity available in all Source Source games. It creates rain, snow, or ash inside its volume.

C++ Class hierarchy
CPrecipitation
CBaseEntity
C++ effects.cpp
Icon-Important.pngImportant:This is a preserved entity in Day of Defeat: SourceTeam Fortress 2.
If the game has round restart mechanics this entity may not behave as expected:
More info
  • On a new round entities with this classname will intentionally not reset. You can use logic_auto to emulate resetting it.
  • Killing it removes it forever, as it is not respawned on a new round.
  • It cannot be spawned with a point_template.
  • Parenting this with non-preserved entities may have undesirable effects.

Keyvalues

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

Density (0-100%) (renderamt) <integer>
This is the amount of particles that fall down from the top side of the brush. However, distance from first particle to second depends on a brush volume size!
Color (R G B) (rendercolor) <color255>
Color added to sprites which are rendered transparently (probably rain and snow particles)
Precipitation Type (preciptype) <choices>
Precipitation type
Note.pngNote:The "Particle" precipitation types are generated using the PCF files of a game, allowing users to alter the look of the precipitation in more ways than just the used material.

Inputs

Alpha <integerRedirectInput/integer> !FGD
Changes the density of the rain, and may add additional particle effects like fog or leafs. It accepts inputs from -1 to 255.

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.

See also