Page 1 of 1

Rain Effect theories

Posted: Sun Jun 18, 2006 9:20 pm
by Hydrate
Well, i have been looking into rain effects, and im wondering , how would you do yours? Personally i tried using a structure with x.l and y.l in it and having it draw everything in it at the right values, but it doesnt seem to work, so in theory, how would you do it?

Posted: Sun Jun 18, 2006 9:49 pm
by Joakim Christiansen
I think you also need gravity and mass for the rain drops, and each rain drop should have a little difference in mass so not everyone have the same speed.
And you need a wind_direction and a wind_force varibale which pushes each rain drop toward it's direction with it's force, and the rain drops with more mass should be less affected by the wind force.
Hehe, I didn't write that very well... but whatever, good luck!
Maybe I should try to write my own rain effect and share.

Here is a little code I have for gravity:

Code: Select all

      \GravityX + Cos(GravityDirection*#RAD)
      \GravityY + Sin(GravityDirection*#RAD)

  \GravityForce + \Gravity
  \X + \GravityX * \GravityForce ;gravity force should be a small value like 0.02
  \Y + \GravityY * \GravityForce

Posted: Sun Jun 18, 2006 10:16 pm
by rsts
General discussion?

It never rains in my programs (although sometimes it does rain on them) :D

None the less, quite interesting discussion, Joakim, maybe I should spend time in other PB forums as well :wink:

cheers,

Posted: Wed Jun 21, 2006 8:20 am
by Rescator
Hmm! What about just using a particle generator for the rain?

If you do it just for the falling raindrops in a "cut" circle (the cake piece should match the player view of field obviously) I doubt the cpu load would be too much and I believe most GFX cards has hardware support for such particle effects as well?

Altough if it's a full view 3D game where the player can control the camera in a full 360 and up/down then you might need to make a hemisphere around the player using your rain particles, this would need more cpu obviously.
But the advantage would be that these particles (correct me if I'm wrong please!) would be in true 3D and not appear "painted on using 2D" as rain in many games tend to look like.

And if you want to do really a heavy storm or thunder rainshower combine this with a "camera" shader like effect (does real shaders allow "camera" effects?) that slightly warps the view so that it looks like rain/water is somewhat obscuring the "glass". Should make a impressive result.!