Archived

This topic is now archived and is closed to further replies.

rain simulation

This topic is 5576 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Does anyone know where i could get some information on rain simulation? Or general rain effects - formulae/code? I googled it but didn''t have a great deal of success. I saw somewhere something about inverse fournier series or something like that. I dunno. Thanks for any tips

Share this post


Link to post
Share on other sites
For a real rain effect I truly recoment using a particle system. As mentioned before you can also use animated textures on a quad, but that wont provide an effect as nice as the particle system.
Besides that a particle system will let you do many other things, such as changing the ''wind'' direction, make the rain fall faster... etc... Particle systems are great!

"I code, therefore I exist"

Share this post


Link to post
Share on other sites
a single quad covering the whle screen does workquite well, the problem with particles is u need a hell of a LOT of them

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
You could do a rain particle system with a "weather cube" - here is a cut+paste from a mail by Thatcher Ulrich:

---------
For the snow in Soul Ride I made a set of particles inside a "weather
cube" (concept due to Mike Linkovich). I used 32-bit ints for the 3D
coordinate of each snowflake, scaled such that my cube used the entire
32 bits. To simulate snowfall and viewpoint motion, I computed the
sum of those displacements and scaled them into my weather cube
coords, and ripped through all the snowflakes adding the same
displacement to each one (all integer ops). No need to check for
overflow; the flakes would just wrap around correctly. The display
was just a simple billboard, in a loop inside glBegin(GL_QUADS). I
was planning to do some turbulent motion by adding in offsets from a
short pseudo-random table, but never got around to it.

Worked fine for a few thousand flakes on low-end 3D HW. The max was
10K flakes, which I think was a measurable hit, but not insane. My
flakes were relatively large, so maybe it wouldn''t be as cheap for a
good dense starfield.
---------

Share this post


Link to post
Share on other sites
It should be straightforward with a particle engine obeying the projectile motion equations just set the gravity y to -9.8 give it 0 initial force, position it high up and it''ll drop like rain. For wind just add a slight gravity x. That''s how I did it for a waterfall anyway and it looks great

Share this post


Link to post
Share on other sites