Sign in to follow this  

Make rain splash effect (pixel shader only)

Recommended Posts

Hello guys

I've made a fake wet surface pixel shader (HLSL/SM5) which I want to animate with an effect of rain falling onto the totally wet ground.

The wet look is generated by manipulating the respective pixels' color and gloss and adding some reflected sky color. I'm distorting the effect with a slight sin wave in order to simulate a little flow / wave effect on the wet surface. That looks fine when it doesn't rain anymore but the ground is still wet.

Now I like add more distortion to generate a look of rain splashing onto/into my puddles on the ground. I already have nice little rain ripples, so that's not the issue.

The problem is rather that I'm not sure what distortion logic / mechanism / formula to apply to make the water distortion by the rain splashes look authentic. Just increasing the amplitude and/or frequency of my sin distortion doesn't look realistic. I guess the water surface distortion when rain falls into a puddle behaves different, not like wind blowing over the surface making waves (what could be achieved by sin distortion).

Any ideas how I would be able to produce a half-authentic looking effect here?

Share this post

Link to post
Share on other sites
I think what you are looking for would be something like a 2D-sinc function, which is essentially a scaled sine function with respect to a given 2D point on your surface. I'm not entirely sure how you would spread them out and manage their lifetimes (i.e. it starts when the drop hits, then lasts for a while and goes away), but they should approximate the effect you are looking for.

On the other hand, if you want to have a single ripple travelling outward, you can always use a regular sine wave, but attenuate the amplitude of the sine wave as a function of the distance from the rain drop contact point.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this