Screen Distortion Rain

I made a version of this when glass first came out, and it got nice responses. Someone recently brought it back up, so I figured now is as good a time as any to remake it!

For games with rainy environments, having droplets on screen can really add immersion to the game.
My original inspiration for this was Hard Reset: Redux. It was a small feature, but it felt so good. For showcase places, it’s even better.


What does it do?

This creates small “water droplets” on the screen, using Glass material balls to give it a distortion effect.


Features:

  • Customization
local Settings = {
	-- How many droplets spawn per second
	Rate = 5,

	-- How large the droplets roughly are (in studs)
	Size = 0.08,

	-- What color the droplets are tinted (leave as nil for a default realistic light blue)
	Tint = Color3.fromRGB(226, 244, 255),

	-- How long it takes for a droplet to fade
	Fade = 1.5,

	-- Update frequency
	UpdateFreq = 1 / 45,
}
  • Droplet Formation

Using a bit of math.random(), it gives natural feeling droplet formations (not just single spheres) and gives some nice variations to the droplets.

  • Droplet “Running”

Droplets are created via a SpecialMesh, allowing them to be streched down, imitating a “running” effect.

  • Coverage Detection

If the camera goes under a roof, or tree, or any sort of cover, the raindrops will stop spawning.

  • Camera Angle Conditions

If the player looks down, thus shielding his/her eyes from the rain, the droplets stop spawning.

  • Render Settings Compatibility

Because Glass doesn’t render properly on low graphic settings, if the player lowers their settings below 8, it stops rendering. This way, you don’t have to worry about lower settings failing to run the game properly. They just won’t have the extra bonus immersion. :man_shrugging: (This only works if it isn’t set to Automatic, since Roblox still doesn’t have a way to check graphics quality on auto. Auto will always spawn droplets.)

Warning:

It relies on glass, and therefore brings with it all the limitations of Glass.


Files:

Example place:

GitHub Repository: (Contributions and forks are welcome!)

Roblox Library:




Enjoying my work? I love to create and share with the community, for free.

If you’d like to help fund my work, consider sponsoring me on GitHub/Patreon or donating on BuyMeACoffee/PayPal!

513 Likes

Thank you, thank you, THANK YOU! Was about to look for someone who could script this effect for me. You’re a life saver!

16 Likes

Aren’t you the same person who made that one dual rendering resource for gun scopes? You’re quite the magician at work and I have got to thank you for making such a thing public.

Take the like, I’ll take the model.

25 Likes

I been waiting for this thanks for this man you really did a good job know i can use it in games :laughing:

5 Likes

Looks great, I only wish it was possible to make it harder to distinguish the spheres connected in droplets though.

6 Likes

You could edit it so that the droplets are turned into a union. That should fix the effect but might make a bit of lag.

5 Likes

You’re welcome! Enjoy!

5 Likes

Yup, that was me! Thanks!

Enjoy!

3 Likes

I considered that, actually, but decided that live unioning is just not a great feature yet and held off on it.

2 Likes

Wow! This is amazing. You’re seriously incredible, you come here out of nowhere scripting some awesome things, and then you uncopylock them!

If anyone on this forum deserves to become a ”Roblox Champion”, it’s you.

11 Likes

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

3 Likes

Amazing!!! I’ll definitely be using this some time in the future. Thank you!!

3 Likes

I used your first version over a year ago, really neat effect. Awesome to see how you have improved with your scripting practices in that time.

3 Likes

This is really cool. My only suggestions would be make it less opaque since rain drops aren’t that blue. Also, if you could implement a running method that would be rather neat. One where when the camera is facing up the droplets don’t move, but if the camera is vertical(level) the droplets will run down the screen a bit. I know it’ll be a little more difficult, but it’d really help make this more realistic. Still cool regardless.

5 Likes

I finally got what I needed! Thanks so much man. :hugs:

2 Likes

I wanted to do something similar. In my opinion, it looks very good. Good job. I will use it in my future projects.

3 Likes

Exactly. The best way to incorporate unions would be having a bunch of prefabs, since the real time unioning system isn’t adequate for a lot of quick real time operations yet sadly :frowning:

3 Likes

I might consider using this with my upcoming swimming system

3 Likes

I’ve put lots of thought into that already.

When water runs down an object, it doesn’t just move down; it distorts and stretches. This makes it really hard to do without vertex deformation in Roblox.

I will attempt this using SpecialMesh sphere objects later. It won’t look great, but maybe it’ll be alright! One way to find out!

EDIT:

Woahhh this came out far better than anticipated. About to polish and then edit the OP!

EDIT 2:

Post has been updated!

5 Likes

Nothing like some good old raindrops in yer eyes. :wink:

4 Likes