Experimentation with drainage on proceduraly generated terrain

Hi folks,
It’s been a while since i was active on this forum. Nice to see the project flourishing.

A few times in the past when playing with procedurally generated terrain i got annoyed by my inability to create realistic rivers; Generating terrain on which every point above sea-level has at least one lower neighbor is quite tricky.
A few months ago i had a brainwave. I can generate maps where rivers correctly flow down hill in O(log n) time.
Babylon.js provided an easy tool to create a demo so here i am.

If anyone’s interested in the algorithm you can find it here:

If you just want to play with the demo:

It works fine for me on Firefox and Chrome.
I don’t have any other browsers to test on so let me know if you have issues.



Neat :slight_smile:

I should probably put some screenshots too:

1 Like