L3DT users' community
Large 3D terrain generator

Rivers plugin

Correspondence concerning plugins and scripts; development, use, bugs and ideas.

Rivers plugin

Postby Aaron » Thu Aug 02, 2007 12:39 pm

Hi All,

I've uploaded an alpha release of the rivers plugin to here:

http://www.bundysoft.com/wiki/doku.php?id=plugins:calc:atRainMaker

Note that to use this plugin, you will have to update to the latest dev build of L3DT Pro (2nd of Aug).

Before anyone gets their hopes up: it's very, very rudimentary. It's slow. It's really hard to get what you want. The progress display is quite busted, and there's no cancel yet. There is no user interface at all, in fact. To do anything, you have to enter scripts (I've provided the ones to use on that page). I'll build a GUI once the algorithm settles down a bit more.

On the up-side, it does support mosaic maps out of the box. It also supports 'undo'. Plus, it will show the flood progression in Sapphire if you know how to ask (it's in the scripts). The scripting also allows interested parties to tweak all the parameters, change filtering algorithms, etc.

Also note that most climates won't work with a map covered with rivers. You'll need to turn the climates' water coefficients down somewhat. Such is the fun of experimental code.

Anyhoo, I'll come back to this in a little while. Atlas calls...

Cheerio,
Aaron.

PS: I just realised that Sapphire needs some more tweaks to display rivers edges properly. I'll include those in the next release.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby monks » Fri Aug 03, 2007 7:53 am

Hi Aaron, you mentioned the sed accumulation/deposition maps in the page- now that could really make big improvements to L3DT's textures via attribs. I'm guessing the rain map will be calculated before the attributes? I'm thinking the rain map could be used for a flow map (yes obviously!).

monks
monks
Oracle
 
Posts: 292
Joined: Tue Nov 22, 2005 10:38 pm
Location: Middle Earth

Postby monks » Mon Aug 06, 2007 12:14 pm

Hi Aaron, I've just been running the rivers plugin and I like the results. I think my its need to go up to get the rivers flowing right down to lakes. :) There's a whole lot of potential here.

Is there any way to import/export flow maps, so that we could process them in Photoshop?

What are the options from script processing of the flow maps? I can see that getting rid of many small lakes would be useful.

Is there any way to import a flow map from another prog?

monks
monks
Oracle
 
Posts: 292
Joined: Tue Nov 22, 2005 10:38 pm
Location: Middle Earth

Postby Aaron » Wed Aug 08, 2007 10:45 am

Hi Monks,


monks wrote: Is there any way to import/export flow maps, so that we could process them in Photoshop?


Export is easy. Go to 'File->Export->Export map...', select 'Rain-avgdepth', and export the map in whichever format you like. To re-import, use the following script in ZeoScript:

Code: Select all
ExtAPI.map.LoadFile <m:Rain-avgdepth> <z:file.OpenDlg NULL NULL "Bitmap images (*.bmp)|*.bmp|"> 20 <f:HF 0 bmp> false true


(this assumes the file is a bitmap. To use another format, change all three "bmp" references to the appropriate extension.)

monks wrote:What are the options from script processing of the flow maps? I can see that getting rid of many small lakes would be useful.


The flow map is technically a heightfield (32 bit float per pixel), and consequently most of L3DT's heightfield processing functions can be used on the flow map, including clipping, clamping, scaling, smoothing, etc.

I might suggest you take a look a the 'atFuncBrowser' plugin (pre-installed), which lists the script functions you can use. Using the 'Extensions->atFuncBrowser->Browse functions' menu option you can browse all the script functions that are available in L3DT. Under the 'calc.HF' tree are the heightfield processing functions. The ones you'll probably want to use at the 'calc.HF.ClampMap' (to clamp the vertical range), 'calc.HF.ScaleMap' (to multiply all pixels by a value) and 'calc.HF.ShiftMap' (to add/subtract a value from all pixels). On the wiki page for the rain plugin I use the following example:

Code: Select all
calc.HF.ShiftMap  <m:Rain-avgdepth>  -1 


This subtracts 1m of height from every pixel in the 'Rain-avgdepth' map. If you want to get rid of little lakes, you may wat to subtract even more height from this map. The ClampMap/ScaleMap functions work in much the same way, but with more or less function arguments (see atFuncBrowser for the definitive list of function arguments).

I am aware that such scripting is not for all; once I've worked out what are the most useful options/algorithms/parameters/etc, I'll bash together a 'nice' GUI for general use. I think much more experimenting is required before we get to that.

Cheerio,
Aaron.
Last edited by Aaron on Mon Aug 10, 2009 9:54 pm, edited 1 time in total.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby monks » Fri Aug 10, 2007 2:48 pm

Excellent!- I wasn't so sure about the map import.

monks
monks
Oracle
 
Posts: 292
Joined: Tue Nov 22, 2005 10:38 pm
Location: Middle Earth

Postby nicethugbert » Tue Oct 14, 2008 5:44 pm

What are some rules of thumb for getting results out of atRainMaker? Any sample maps laying around that coudl be used to get results from atRainMaker?

I imagine that eroded/arid areas would be counter productive here.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby nicethugbert » Mon Aug 10, 2009 9:19 pm

Status?
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby Aaron » Mon Aug 10, 2009 10:33 pm

Hi nicethugbert,

The atRainMaker plugin is now a little out of date and needs to be revised to work properly with some other plugins (L3DTio_Backup, etc.) It probably also needs a 'cancel' button on the progress bar. I'll post back here when the update is ready for download.

As for tips on usage, I'm not really sure I can offer useful advice right now. This plugin was/is very experimental, and I don't understand (or rather, remember) the characteristics of the algorithm well enough to be able to be able so say what inputs should be used to get particular outputs.

Cheerio,
Aaron.

Edit: I've updated the plugin to fix compatibility with the latest build of L3DT Pro. A cancel button has also been added, and the test code for rendering in Sapphire during flooding has been permanently removed.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby SharkD » Fri Aug 28, 2009 4:09 am

Before and after screenshots please.
SharkD
New member
 
Posts: 4
Joined: Fri Aug 28, 2009 4:07 am

Postby KrisWood » Sat Jan 02, 2010 9:26 am

In earlier posts in this thread you mentioned the plugin working with the professional version. Does it not work in standard? I've attempted using it in the latest standard version and only get what looks like noise, definitely no flowing going on.
KrisWood
New member
 
Posts: 6
Joined: Sat Jan 02, 2010 8:40 am

Postby Aaron » Sun Jan 03, 2010 10:25 pm

Hi KrisWood,

I'll check the plugin later today, but my recollection was that it was fully compatible with the Standard edition. Can you post here (or e-mail aaron@bundysoft.com) a screenshot of the 'rain-avgdepth' map layer produced by the plugin?

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby KrisWood » Mon Jan 04, 2010 3:43 am

I'm trying some different things to see what effects it and will post images shortly. It's becoming apparent though that the static effect I'm getting is due more to my heightmap data than to your plugin. On low resolution heightmaps the "stair step" appearance between altitudes becomes somewhat terraced when calculated three dimensionally. I was able to get around this by blurring the heightmap in photoshop, which changed the rainfall from thousands of tiny puddles into something resembling japanese rice patties. From this I can tell that the plugin does appear to be functioning as intended. I'll post some images when I have a better idea what I'm posting. :)


Ok I've verified that it works flawlessly with the st. helens dem from your examples page. I'll look for better heightmap data. :)
KrisWood
New member
 
Posts: 6
Joined: Sat Jan 02, 2010 8:40 am

Postby KrisWood » Mon Jan 04, 2010 6:03 am

Ok here's the results, click the images to see more sizes on flickr:

First attempt, using a low res heightmap off the net:

Image

Second attempt using a higher res heightmap and scaling down the world size to 1% of real life:

Image

End result, looks quite nice for being only 2048x1024, should be even better once I can import straight from MOLA :)

Image
KrisWood
New member
 
Posts: 6
Joined: Sat Jan 02, 2010 8:40 am

Postby Aaron » Mon Jan 04, 2010 9:59 pm

Hi KrisWood,

The problem here seems to be that the terrain was too low-res / rough for the plugin to find any river paths. This calculation doesn't actually erode the terrain to make rivers; rather, it fills eroded channels with water. If there are no eroded channels, then no water flows, and thus no rivers.

Generally speaking, the river calculation will work better with high-resolution terrain with low noise, where either the terrain has been naturally eroded (in the case of real-world terrain), or eroded by a calculation.

Below is an example of the flow map generated by the plugin from an 8.5m resolution DEM from Romania. This terrain is highly eroded, and as you can see, the flow calculation did a reasonable job of finding the river channels.

Image

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby Telarus » Sun Feb 07, 2010 11:10 pm

Hi Aaron.

I've installed the atRainMaker plugin, and have tried running it via the zeoScript editor. I get this as an error:


Code: Select all
ZeoScript error: Unrecognised command 'm:HF'.
 - Line 1: 'calc.WM.rain <m:HF> <m:WM> 1 100 1 1 1'

ZeoScript error: Compilation aborted following errors.
 - Line 1: 'calc.WM.rain <m:HF> <m:WM> 1 100 1 1 1'

CZeoFunc::CallFunction error:
 - The function 'ExtRunScriptEx' in the plugin 'ZeoScript' returned an error.


Any idea what's happening?

Edit:: That was with the 2.8.0.7 dev build. Seems to be working ok in the 2.8 build.
Telarus
Doyen
 
Posts: 112
Joined: Mon Jun 01, 2009 12:34 am

Next

Return to Plugins and scripts

Who is online

Users browsing this forum: No registered users and 2 guests