Jump to content
  • Advertisement
Sign in to follow this  
Quat

Water Flow Collision and Response

This topic is 2751 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

I am building a water particle system that uses collision detection to automatically flow down a terrain and other obstructions.

Pic1

It works OK, but it is not taking into consideration some of the physics of water and so it doesn't look natural in some places. For example, here is a close up of an odd path flow.

Odd Path Flow

I know why this is happening: Because I am just using gravity to control the particles. But real water tends to want to spread and fill troughs (is this due to the pressure? Any other forces?).

Any ideas of how to simulate this cheaply? It just needs to look right, not be physically accurate.

Share this post


Link to post
Share on other sites
Advertisement
Having never done this my initial guess is as follows. You have a source and starting from that source point on the terrain every 1 meter in 32 directions find the height (simple interpolation) and choose the lowest direction and go there. Then keep doing that same process and connect each point. When you're done build a spline. I'm sure at that point you can have your particles follow the spline like boids or something naive and not use real physics at all. I bet you could even just generate geometry over the spline to slope into the terrain slightly and just render a flowing water shader on it.

If you still want water particles maybe a weight tower the spline might help curve the flow.

Share this post


Link to post
Share on other sites
At the very least you need to represent some form of friction/drag, otherwise the water particles will accelerate without limit and swoosh up the sides as in your screenshots.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!