Hi, guys, it’s been a while
Please take a look at https://www.openprocessing.org/sketch/845420
Please be sure to run it not from the browser, because it’s slow.
In shortly, what it does:
- Creates a hightmap via diamond square algorithm;
- Assigns each tile (cell) an amount of water;
- Tries to calculate where the water would flow;
- and show it every tick of time.
After some time waiting it should look like this:
The solid ground is shown in brown/orange: the higher, the lighter;
The water above the ground is shown in blueish color, the darker means more water.
- no water erosion envolved yet (I’m not gonna do it until the simplest water flow works as I expect)
- no precipitation/evapouration either so far
It does pretty well what I meant it to do, but
- it’s waaaayyyyy tttooooo ssslllooowwww (no, I mean, I use the ‘write directly into video memory’ technique I used back in those days when the video memory was a segment at
0A000h
. These days it’s calledloadPixels(); pixels[whereINeed] = color(what, I, need); updatePixels();
- and it’s slow not only because it has to draw every iteration. Any suggestions to improve the frame rate?
- I guess I miss something like the water’s resistanse to flow, so that it should stop waving that much finding the equilimrium?
Anyways, any feedback is welcome!