Sign in to follow this  
tasseloff

rain?

Recommended Posts

Alright.... i got to a good point with my water simulation...i think i got the reflections right, the waves seem not bad...i haven't touched fresnel refractions yet because i think i need to focus on the main goal of my project first and that is to create a simulation of rainfall, however, even tho i can simulate the wave that a raindrop will do on my water surface, i don't know how to actually program a visual rain drop falling from the sky onto my water surface and then creating the wave.... any suggestions would be greatly appreciated as im really not sure where to start...i could always create many many small spheres falling down at a certain speed i guess....i really doN't know :/

Share this post


Link to post
Share on other sites
I am by no means experienced with much of anything graphical, but here's an idea that I had as I read your post.

Have a sphere or a box like you were saying fall down to your water surface. You could texture it in a water texture having transparency or whatever you like, then just test for an intersection of the boxes with the water surface to trigger a ripple/wave going? Again, i'm not experienced with this sort of thing, just seemed like something that might work. Good luck.

Share this post


Link to post
Share on other sites
yeah this sounds not bad....its actually the only way i can imagine to do it...im just afraid this is gonna really slow down my simulation tho....it would mean a heck of a lot of small sphere falling down from the sky at the same time...

but i guess unless someone else has a better idea ill have to go in that direction...
tks for the reply

Share this post


Link to post
Share on other sites
Why couldn't you just use texture effects? Blend a texture onto the location of the water where the drop hit, with the ripples moving outward, until they fade past the edge of the texture.

I'm not a 3D graphics person, can anyone tell? :-)

Share this post


Link to post
Share on other sites
What you're actually looking at here is two effects, possibly three:
(a) Raindrops
(b) Raindrop impact effects on water/ground
(c) Raindrop impact effects on camera

The water/ground stuff you can do with texturing. The camera stuff you could also do with texturing, though you might want to look into a refraction system or something.

The raindrops themselves are usually just rendered as a line list and handled as particles - but bear in mind that if you were to render a whole field of rain, you'd basically just end up rendering a solid block of colour across the screen. What you want to do instead is to just have rain for the first X metres away from the camera, and move the rain 'with' the camera (while you're inside the rain field, of course), accounting for the direction the camera's looking in so that the rain is always falling straight down. That way the amount of rain you render is only dependent on the 'density' of the rain, rather than the area covered.

Share this post


Link to post
Share on other sites
You can do something like this:
http://www.geocities.com/opengladiator/imagenes/LLUVIA.zip

The camera always is into a box, something like a skybox, where drops are falling over and over again(particle system). For example you can have 1000 drops. Each drop falls from the top of the box to the bottom, when it reaches the bottom it is restarted in a new position on the top. You can draw the drop as a line or textured box, spheres,...

In the demo the rain box is always in the same position.

I don't know if this is a bad solution, but you can try it.

Sorry but the code of the demo is very bad and the speed is dependant of the CPU speed. I was very young when I wrote it.

I Hope this helps you

Share this post


Link to post
Share on other sites
Actually you could do it without particles (at least the rain you could, anyway) - so long as you didn't need to know precisely where each drop was hitting.

Make 3 polygons big enough to fill the camera, and use the same rain texture on all 3 of them (just a semi-transparent (or fully transparent, your bag) dark blue/grey texture with raindrops falling straight down). Depending on the density of the rain, make the texture size larger or smaller, and change the velocity of the texture. Then set the polys at just in front of the camera, at the limit of the drawn scene, and again in the middle. This way you've created the effect of a dense rain field, but you've done it really easy without using a particle system. And as for the water on water effect, you could just randomly generate a number of places on the water to do that each frame, and have them ripple until their lifespan was over; and only have xx alive at a given time.

It would be a good placeholder until you got a particle system up and running, if nothing else.

Share this post


Link to post
Share on other sites
hmm yeah....but i think im gonna have to go with the particle system anyway unless i really run out of time because i was actually trying to build a simulation so that would be a bit too far from my original goal

Share this post


Link to post
Share on other sites
Here, check this out. It's an example of a 3D water effect using DirectX 8.0, from the book "Special Effects Game Programming With DirectX" (one of the few LaMothe books I wouldn't mind having paid full price for - but I didn't, so I'm even happier :-) ).

There's no nice index page, and I don't have the chapter that accompanies the source in electronic form (bummer - will do it if/when I have time or can find a copy of the book online), but the source, images, and executable are all there for you to have a look at.


Simple 3D Water Simulation (Water Drops/Ripple Effects)

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