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
(→‎Keyvalues: swapped list with nicer looking table.)
m (→‎Related Console Commands: swapped look of table to the other version.)
Line 78: Line 78:
== Related Console Commands ==
== 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.
:{| class=standard-table
{{Table
! Command Name || Value || Description
| {{tr
|-
| {{th|Command Name}} {{th|Value}} {{th|Description}}
| r_RainParticleDensity {{as}}{{portal2}} || <[[float]]> || Set the density to enable or disable any precipitation particle. Value '''1''' to enable and '''0''' to disable.
}}
|-
{{tr
| r_rainalpha || <[[float]]> || Adjusts transparency of rain particles.
| {{td|r_RainParticleDensity {{as}}{{portal2}} |dark=1}}
|-
{{td| <[[float]]> }}
| r_rainProfile || <[[bool]]> || Displays stats on rain rendering costs.
{{td| Set the density to enable or disable any precipitation particle. Value '''1''' to enable and '''0''' to disable.}}
|-
}}
| 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|Rain may fall through brushes when this command is enabled.}}
{{tr
|-
| {{td|r_rainalpha |dark=1}}
| r_rainspeed || <[[float]]> || Lower values will cause rain to disappear sooner and fall slower. Default value is '''600.0f'''
{{td| <[[float]]> }}
|-
{{td| Adjusts transparency of rain particles.}}
| r_RainSideVel || <[[float]]> || Controls sideways movement of the rain particles.
}}
|-
{{tr
| r_RainSimulate || <[[bool]]> || Toggles animation on the rain; freezes the rain when set to 0.
| {{td|r_rainProfile |dark=1}}
|-
{{td| <[[bool]]> }}
| r_rainwidth || <[[float]]> || Widens the rain's alpha to desired value. Default value is '''0.5'''
{{td| Displays stats on rain rendering costs.}}
|-
}}
| r_RainRadius || <[[float]]> || Distance from the brush where the rain starts/stops rendering.
{{tr
|-
| {{td|r_RainHack |dark=1}}
| r_rainlength || <[[float]]> || Changes the length of the rain particles. Default value is '''0.1f'''
{{td| <[[bool]]> }}
|-
{{td| Overrides density values set in Hammer. Enabling will result in longer and more dense rain than at 100%. Can help solve visibility issues. {{note|Rain may fall through brushes when this command is enabled.}}}}
| r_RainSplashPercentage || <[[float]]> || Percent chance of splash particles spawning when a particle is used.
}}
|-
{{tr
| r_raindensity || <[[float]]> || No function. Use <code>r_RainParticleDensity</code> instead.
| {{td|r_rainspeed |dark=1}}
|-
{{td| <[[float]]> }}
| r_rainalphapow || <[[float]]> || Raises the value of <code>r_rainalpha</code> exponentially. {{confirm|Some say this has no effect?}}
{{td| Lower values will cause rain to disappear sooner and fall slower. Default value is '''600.0f'''}}
|}
}}
{{tr
| {{td|r_RainSideVel |dark=1}}
{{td| <[[float]]> }}
{{td| Controls sideways movement of the rain particles.}}
}}
{{tr
| {{td|r_RainSimulate |dark=1}}
{{td| <[[bool]]> }}
{{td| Toggles animation on the rain; freezes the rain when set to 0.}}
}}
{{tr
| {{td|r_rainwidth |dark=1}}
{{td| <[[float]]> }}
{{td| Widens the rain's alpha to desired value. Default value is '''0.5'''}}
}}
{{tr
| {{td|r_RainRadius |dark=1}}
{{td| <[[float]]> }}
{{td| Distance from the brush where the rain starts/stops rendering.}}
}}
{{tr
| {{td|r_rainlength |dark=1}}
{{td| <[[float]]> }}
{{td| Changes the length of the rain particles. Default value is '''0.1f'''}}
}}
{{tr
| {{td|r_RainSplashPercentage |dark=1}}
{{td| <[[float]]> }}
{{td| Percent chance of splash particles spawning when a particle is used.}}
}}
{{tr
| {{td|r_raindensity |dark=1}}
{{td| <[[float]]> }}
{{td| No function. Use <code>r_RainParticleDensity</code> instead.}}
}}
{{tr
| {{td|r_rainalphapow |dark=1}}
{{td| <[[float]]> }}
{{td| Raises the value of <code>r_rainalpha</code> exponentially. {{confirm|Some say this has no effect?}}}}
}}
}}


{{warning|<code>func_precipitation</code> brushes should not overlap <code>[[func_smokevolume]]</code> brushes, as it can freeze the game. The exact cause of this is not clear.}}
{{warning|<code>func_precipitation</code> brushes should not overlap <code>[[func_smokevolume]]</code> brushes, as it can freeze the game. The exact cause of this is not clear.}}

Revision as of 06:02, 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.

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