Hi everyone!
I’m releasing an open-source module (and plugin) that produces the rain effect that you may have seen in the Egg Hunt 2018’s Hardboiled City world. Since then, I have improved the effect quite significantly in terms of API and you can modify it a lot more, and I’m now ready to share it.
This rain effect is designed to be drag-and-drop. It will work in most games out of the box, and there are a lot of options to toggle either through scripts or through the plugin. It also only makes the rain effects appear outdoors and you will see the rain effect when you are indoors and look outside.
A user-friendly plugin is made available so that non-scripters can easily put the rain effect in their games, showcases, and other experiences and adapt it to their liking!
Get it now:
Download the plugin here:
https://www.roblox.com/library/2166774609/Rain-Plugin
You can enable, disable, preview, and modify the rain effect through the plugin in any of your games!
Examples of the effect/plugin in action: (click if gifs don’t play)
https://gyazo.com/5d28872b140da5a3e1b5f24dd4bf669c
Get the module stand-alone: (for programmers)
Download the module:
Rain.rbxm (14.4 KB)
Or grab it from the toolbox:
https://www.roblox.com/library/2166863728/Rain-Module
Or view the source code of the module/plugin here: (pull requests, comments, bug reports welcome!)
API documentation is available in the module / on the Github page.
Design notes:
I use particle emitters and a lot of moving attachments to pull off this effect in a relatively cheap way. It is not intended to simulate a realistic rain effect because this is pretty much impossible without either raytracing individual raindrops and splashes (too performance intensive) or using a custom shader / post-processing effect / more complicated particle system (all of which are not possible to do on Roblox).
This is pretty much the cheapest alternative you are going to get, and it looks pretty good in my opinion.
Summary of trade-offs:
Pros:
- Works (out of the box) with any kind of geometry.
- Full occlusion support (no rain in places that should be blocked from rain, i.e. under roofs, inside buildings).
- Works with moving objects (splashes even land on characters).
- Dense rain effect opposed to trail-based approaches or effects that simulate only a few individual rain drops.
- Fully customizable properties (color, direction, sound volume, textures, sound asset, intensity, …).
- Performant enough to use in real games and on mobile (see Egg Hunt 2018, runs fine on iPhone 5S and higher).
- Rendering performance is not an issue since it uses ParticleEmitters which Roblox tones down automatically depending on quality level / graphics load.
Cons:
- Visibility of effect is dependent on quality level (this is both a pro and a con).
- Visibility can be impacted if there are a lot of other particles in the scene already, or can suppress other particle emitters in the scene.
- Not intended to simulate fully realistic dense rain, it’s a stylized effect that may or may not work for your game environment.
- The rapidly moving attachments and particle emitters can lead to minor performance issues in certain edge cases due to Roblox not optimizing for rapidly re-positioning particle systems.
Show me your creations!
If you find a good use for this effect, please reply with screenshots or gifs/videos below or put them on Twitter and tag me at @buildthomasRBX, I’d love to see what everyone can do with it.
Also, if you improve the source code for the effect / plugin in any way, I really recommend submitting a pull request to my repository or letting me know what you changed, so that everyone can benefit from the changes, just like you have benefited from me releasing this module.
Thanks for reading, and excited to see what people will do with it!