Simulating erosion in Blender part V, a rain map

It is time to finalize the necessary features of the addon before giving the erosion algorithms a close look again. This new revision (0.0.2) of the addon sanitizes the UI a bit and adds an option to control the distribution of the rain.

New options

The way we distribute rain over the mesh has changed a bit. Instead of just a uniformly distributed amount with some local variation it is now possible to use a rain map. If the option Use rainmap is selected the local amount of rain is multiplied by the weight of the active vertex group (if there is no vertex group, the option is grayed out). So for each iteration the amount of water raining down on a single vetex position is given by
Ka * weight * (1 - Kv * U)
where U is a uniformly distributed random number.

The whole idea is that we can use such a weight map to create a side of a mountain range where it rains relatively more due to prevailing winds or to mark a spot on the side of a hill as a well spring.

Note that the amount of rain Ka has a soft maximum: the slider will stop at 1 but you can type in larger values by hand. Also note that the weights of any vertex group but the active one are set to zero. This is an unfortunate byproduct of the way we calculate the mesh. So if you need different vertex groups later on, for example to control the density of a particle system that generates trees, you should create them after you're finished with the erosion calculations.

Another option that was added is mesh statistics. If checked it displays a panel with some height and slope statistics of the mesh.

Code availability & feedback

The code is available as an installable .zip file on GitHub. You can install it as a Blender addon by choosing File->User preferences->Addons->Install from file and selecting erosion.zip. Don't forget to enable the addon. The package is dependent on Numpy and having Numexpr and Psutil installed is recomended (the first for serious speedup, the latter for accurate timings, see the opening page of the erosion repository for more info). After the installation the addon is available if you select an object in the 3D View and choose Object->Erode.

Note that if you have installed the erosion addon before, reinstalling it might not get rid of all files in the previous installation. You might try to restart Blender after reinstalling or, if the old version still seems to be there, get rid of the installation directory (typically Your Blender Install Dir\scripts\addons\erosion) and install from scratch.

Besides commenting on this article it might be interesting to check out this BlenderArtists thread.

Previous articles

Articles in this are labeled with the tag erosion. The list up til now consists of:

No comments:

Post a Comment