Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Make rain splash effect (pixel shader only)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Meltac   Members   -  Reputation: 425

Like
0Likes
Like

Posted 12 September 2012 - 02:43 AM

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?

Sponsor:

#2 Jason Z   Crossbones+   -  Reputation: 5154

Like
0Likes
Like

Posted 12 September 2012 - 12:18 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS