Make rain splash effect (pixel shader only)

Started by
0 comments, last by Jason Z 11 years, 7 months ago
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?
Advertisement
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.

This topic is closed to new replies.

Advertisement