L3DT documentation
Large 3D terrain generator

Differences

This shows you the differences between two versions of the page.

l3dt:algorithms:wm [2017/08/31 05:35] (current)
Line 1: Line 1:
 +====== Water-mapping algorithms ======
  
 +===== Flooding sea and lakes =====
 +
 +I still haven't written a description of water flooding here, but nobody has asked. The basic concept is relatively easy, but the optimised implementation in L3DT is fairly scary.
 +
 +===== Water table and salinity mapping =====
 +
 +The water table modelling algorithm in L3DT calculates a water 'heightfield' that roughly follows the rise and fall of the terrain whilst smoothly connecting all of the water bodies (sea, lakes, etc). The purpose of calculating the water table is to allow the [[l3dt:algorithms:cli:am_algo|attributes map algorithm]] to assign water-dependent land types such as lake mud, beach sand, lush grass and deep desert.
 +
 +In outline, the algorithm calculates the height of the water table at each pixel using the terrain and water table height of its neighbours, and then iterates several times to reach a stable solution. In algebraic form, a change in the terrain height (<html>&delta;</html>h) when moving from point //a// to point //b// causes a corresponding change in the height of the water table (<html>&delta;</html>w) that may be expressed as:
 +
 +<html><p class = "wikiex_p_eqn">&delta;w<sub>ab</sub> = c<sub>grad</sub> × &delta;h<sub>ab</sub> - c<sub>loss</sub></p></html>
 +
 +where:
 +  * //c<sub>grad</sub>// is an arbitrary coefficient of the gradient((In my implementation, the gradient coefficient is split into two (//c<sub>rise</sub>// and //c<sub>fall</sub>//) for rising or falling land.)), and;
 +  * //c<sub>loss</sub>// is an arbitrary linear loss coefficient.
 +
 +Using the above equation, the algorithm rasters across the map in various directions((Eight raster orders are used for this.)) calculating the height of the water table at each pixel, based on the water table height of the last pixel and the change in terrain height from the last pixel to the current pixel. If the calculated value is greater than the current water table height, the water table is set to the new height and the algorithm moves on to another pixel. The procedure is iterated a few times to achieve a satisfactory solution.
 +
 +This equation is a massive simplification of genuine hydrological-modelling, with all of the complex parameters such as soil porosity, rainfall, and so-forth being hidden in those coefficients. They are, therefore, effectively arbitrary, so please feel-free to tinker with them in the '[[l3dt:userguide:ops:wm#flooding_the_water-table|water table modelling]]' wizard.
 +
 +Salinity is handled in a similar manner to the water-table height, but with a slightly different equation that has, at best, marginal grounding in reality. 
 +
 +<html><p class = "wikiex_p_img"></html>
 +{{ l3dt:algorithms:wm:desertwm.jpg }}
 +<html><br/></html>
 +Combined water body, water-table and salinity display.
 +<html></p></html>
 +
 +There are more pretty screenshots of this in the [[l3dt:userguide:view:schemes:wm|water map display schemes]] guide.
 +
 +
 +===== Rivers =====
 +
 +The [[bundywiki>plugins:calc:atrainmaker|RainMaker]] plugin is about all I've done for rivers so far. I intend to revisit this someday. 
 
l3dt/algorithms/wm.txt · Last modified: 2017/08/31 05:35 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki