Sign in to follow this  

Procedurally generated rivers and lakes

Recommended Posts

This is for spherical planets, not a flat world. I procedurally generate solar systems to include planets and moons. I have oceans and land masses, but where I am stuck is in reliably generating lakes and rivers that make sense. Does anyone know of a method for doing this that doesn't take a huge amount of time?

Share this post


Link to post
Share on other sites

In my last project we used an artistic approach which worked the following way.

We used the spline points based road system, added logic to subdivide the spline and add noise to the interpolated positions.

The artist was capable to add a river with some clicks and that way we were capable to get a 3D version of the painted map we got from the IP we were working with.

We used http://www.world-machine.com/ to get the simulation of rain and rivers in the heightmap.

With the information of begin and end of the splines we also achieved a flow of water.

 

An procedural solution can be realistic or not and depending on it the time it takes will rise.

Hydraulic erosion simulation are the keyword, you get a heightmap(vertices or pixels) and then set points where the water will start and also consider melting ice and rain.

Rain will do a global erosion which can easily be parallized and achieve the biggest visual impact.

Ice can be handled like rain but only on specific areas.

(Realistic simulation would consider melting and freezing, which crack big rocks and can move bigger stones with ease. But I think it far from what you want/need.)

Flowing water will be like rain from a very tiny point with a lot of particles.

After you did the erosion you can emit particles from the river start point(without changing the terrain) and track the flow of the particles and create a spline.

With the spline you can create a mesh which can be animated.

 

http://codeflow.org/entries/2011/nov/10/webgl-gpu-landscaping-and-erosion/

http://gamedev.stackexchange.com/questions/31263/road-river-generation-on-2d-grid-map <- not realistic but fast and looks good

http://hpcg.purdue.edu/bbenes/papers/Stava08SCA.pdf <- runtime gpu

 

If I got it right you need a realtime solution which means you have to abstract the whole simulation alot.

I would suggest to start with a global erosion with with a single diget number of steps(each LOD level will refine the results of the previous level).

Pick random points which are higher as the sea level and use the linked cheap A* trick to find a path to the next sea level ocean/sea(search in the direction the normal of the point is looking to).

I would start with a voronoi bases(https://www.codeproject.com/articles/882739/simple-approach-to-voronoi-diagrams) approach to set the start points if you create the whole planet at once or reduce the area by a small border and do this to avoid 2 rivers beside of each other on the border of a tile.

In the second case you should avoid long rivers as you have to process the information of a neighbor tile to get a river/lake which cross 2 or more tiles.

 

If you use a spehrical cube then you can also do the lakes on the 6 sides and rivers on a lower LOD.

Combined with clipmap, texture array and copy rectangle you have a cache of the calculated results and can do more complex simulation.

http://www.virtualglobebook.com/ <- I recommend this book for this topic.

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