For too long have we been constricted to @buildthomas’ legendary rain script from 2018. This forum post introduces an alternative rain module, capable of reaching great performance with roof occlusion and amazing visuals. It is completely free for personal and commercial use.
Plugin Download:
https://create.roblox.com/store/asset/135258562786895
Module Download: (Currently moderated and appeal was denied. Use the plugin for now)
Unavailable at the moment
Test in-game: (16+ due to temporary Roblox restrictions)
Videos
Hardware used in videos:
- CPU: Intel i5 7400
- GPU: GeForce RTX 3060
- Ram: 2x16 GB, 2400 MHz, DDR4
Why use this module?
Previous methods often use a ton of particles, which can cause lag. This module reduces particles count in favor of beams, which usually improve performance. Besides this, I believe the visuals look cleaner and less dense, which can be desirable for many games.
How does it work?
- Uses teleporting attachments and beams/particles to animate realistic rain/snow with no moving parts/trails.
- When swapping weathers, old attachments are not removed, just ‘silenced’. This is to reduce memory leaks and lag, but, can cause performance drops if too many different weathers are used. Consider adding a script that calls :Cleanup() when the Weather has been disabled for a long time.
- Three main visual components:
- Beam
Main component to the effect, causes ‘rain streaks’. - Mist particle
A particle that is emitted in the direction of the beam to improve visuals when looking up. - Splash particle
A particle that is emitted at the hit position of the ray.
- Beam
How is it able to achieve high performance?
In short, here is a list of some optimization tricks used:
- Fully client sided
- Textures
Each beam/particle has multiple rain drops or snowflakes, which makes it look like it is simulating individual rain drop when it is not. This creates a dense effect while not reducing performance. - Camera positioning
The effect is not simulated everywhere, only around the camera of the player. - Instance allocation
Reuses old attachments by storing them internally. Improves performance because creating/deleting instances is laggy. - Storing transparency tweens
To smoothly fade beams, one must ‘tween’ their NumberSequence transparency values. My module reuses old NumberSequence tween values to improve performance. For example, tweening a beam from 0 to 1 stores an array of NumberSequences with values multiplied from 0 to 1.
Upsides/Downsides
Upsides
- Many optimization techniques that greatly increases performance.
- Has customizable dynamic sound with HighGain reductions under roofs.
- Better roof occlusion than most alternatives.
- Preloads assets to remove ‘white boxes’ created by the beams. (These can still appear if loading is slow)
- Weathers are not hard-coded and uses external constructor modules that can be added/removed easily.
- Swapping weathers and enabling/disabling the effect is seamless and smooth.
- The effect is not camera locked, meaning it is not stuck to the camera when it moves.
- Tons of customization that determines visual appearance, raycast direction/area/length and much more.
- Personally my favorite visuals for snow and rain when occlusion is needed.
Downsides:
- Not perfect roof occlusion. Some ‘leaks’ around corners and large incoming angles.
- Lowering graphics does not substantially increase performance due to beam usage.
- Removing the rain collision property will not substantially increase performance.
- No increase in performance from being outside vs indoors.
- Visuals will look bad if you reduce Intensity by a lot. (creates single-beams that stand out)
If you want to support this plugin:
- Sharing this plugin/module.
- Meaningful/supportive suggestions in the comments.
- Reporting bugs/errors in the comments.
- Compare this module/plugin with previous methods (eg. @buildthomas’ Rain). Could compare FPS in occluded vs open areas. Showcase the result in the comments of this topic.
Thank you for reading! I hope this module is able to improve rain/snow in games while keeping gameplay smooth.