LanLou123 / Webgl-Erosion

Interactive Erosion simulation in Web Browser
https://lanlou123.github.io/Webgl-Erosion/
MIT License
227 stars 31 forks source link

Rainfall modelling #14

Open SnowyJune678 opened 3 years ago

SnowyJune678 commented 3 years ago

Rainfall modelling appears to be present in an older version (as shown in this video https://www.youtube.com/watch?v=_8y9peDmtwg) but seems to have been removed.

Could this be re-implemented, and what challenges are there in doing so?

SnowyJune678 commented 3 years ago

Edit: rainfall modelling appears to have been removed in this commit: https://github.com/LanLou123/Webgl-Erosion/commit/dfa81ce30d3ed6ed3d13bd8e6796bb950e3e3cc5

LanLou123 commented 2 years ago

I removed it because some changes I did made it looks worse (can't remember precisely what), I'm currently experimenting with some new rain methods and will possibly add it in near future.

SnowyJune678 commented 2 years ago

I'm not familiar with shader programming (where most of the computational work seems to be done) but would like to implement the feature back myself, could you point me in the right direction?

LanLou123 commented 2 years ago

Sure, not sure if you already know this but there are in genereal 3 ways to simulate erosion according to all the research people have done over the years : Grid based : https://cgg.mff.cuni.cz/~jaroslav/papers/2008-sca-erosim/2008-sca-erosiom-fin.pdf, Particle based : https://www.firespark.de/resources/downloads/implementation%20of%20a%20methode%20for%20hydraulic%20erosion.pdf, Connected graph : https://hal.inria.fr/hal-01262376/document I used grid based method which is best suited for GPU implementation, whereas particle based and graph based method are better/easier to implement on CPU, these 3 method both have their advantages and disadvantages, you might want to take a look at the paper I listed and decide which one is best for you, I personally would recommend you to go with particle based and graph based method since you are not going to do shader programming (GPU essentially), however, if you still want to do the grid based method, I think Karhu has a CPU based implementation of this algorithm, here's their github : https://github.com/karhu/terrain-erosion.