L3DT users' community
Large 3D terrain generator

Stitching heightmaps together

Any and all chit-chat regarding L3DT.

Stitching heightmaps together

Postby Aaron » Thu Mar 29, 2012 11:42 am

Hi Everyone,

Over the years I've had numerous requests to add support for seamlessly stitching together two or more heightmaps. This is now supported, in an admittedly basic form, in the latest version of L3DT. You can see the results and an explanation of how to use this feature in this tutorial:

http://www.bundysoft.com/wiki/doku.php? ... heightmaps

Feedback is most welcome.

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

Re: Stitching heightmaps together

Postby Stem » Fri Mar 30, 2012 9:02 pm

Hi Aaron,

Have just been having a look. It does work as you show in the tutorial. Thanks, it is a nice addition.

I do have a question. You mention "stitching together two or more heightmaps", however, I get an error "No borders defined" if I try to stitch less than 4 (2x2) maps. Am I possibly making a mistake in the input for stitching just 2 maps? <-<- EDIT, yes, I just needed to set the offset (for single map direction) to half the map size

Regards,

- Stem
Stem
Member
 
Posts: 12
Joined: Wed Mar 14, 2012 6:49 pm

Re: Stitching heightmaps together

Postby drift501 » Sun Oct 20, 2013 2:58 am

Hey Aaron.

I have two 512 x 512 heightmaps that I wan't to stitch together however one is jagged, large mountains and the other is rolling plains. The edges of the mountains heightmap are around 1200m and the edges of the plains heightmap are around 600m. How should I go about stitching the two together and if I set the offsets to 1024 will L3DT create terrain to link the heightmaps in the blank 512 x 512 area or will that area be blank?

Thanks, Zac
drift501
New member
 
Posts: 2
Joined: Fri Jul 26, 2013 11:16 pm

Re: Stitching heightmaps together

Postby Aaron » Wed Oct 23, 2013 11:34 am

Hi Zac,

No, L3DT won't fill in any empty areas when merging maps. It only blends heights across the edges of adjacent tiles.

The first thing to try would be to simply import the two heightmap tiles adjoining one another, then try the blending algorithm with a long blend depth to see if this will be adequate. However, before proceeding I'd recommend you download the latest version of the atEdgeBlender plugin, as it fixes a bug that prevented it from blending only in one axis.

http://www.bundysoft.com/L3DT/downloads/plugins/bin/atEdgeBlender-bin.zip

To use the plugin, extract it from the zip archive and copy it over the existing plugin at:

Code: Select all
C:\Program Files (x86)\Bundysoft\L3DT [version]\Extensions\


If you set the 'BlendDepth' parameter in the edge blender calculation to half of your tile size (i.e. 256) or larger, then the blending might work OK.

If that doesn't work out, another approach might be to manually create a 3rd heightmap to fit between the first two, that roughly matches the heights on either tile edge. It wouldn't have to exactly match, since the merge/blend operation will smoothly blend the edges. If you did this, I'd recommend making a 512x512 pixel heightmap using the blank design/inflate algorithm, then manually edit the height layer of the design map to match the heights of the other two maps. You should also edit the roughness, erosion and cliffs/terraces layers so that these gradually blend from one side to the other to match each neighbour. After creating this heightmap, you would then import the other two existing heightmaps using the merge importer to the left and right, respectively, and finally apply the edge blending calculation to smooth the tile seams.

I hope this helps. Please let me know if it does/doesn't work, or if you would like more detail on any of these steps.

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

Re: Stitching heightmaps together

Postby bendragon1337 » Sun Feb 23, 2014 1:02 am

Hi there.

I've been trying out the tutorial in the first post to merge a total of 132 256x256 grayscale heightmaps together to form only 1 heightmap, this will mean I'll use this feature very heavily in the foreseeable future.

Unlike in the tutorial, the height maps that I have retrieved are designed to go together hand in hand and thus, shouldn't create any seams which would otherwise, require blending.

Just to test this feature, I got 4 of the heightmaps to see how L3DT merges the heightmaps together.

Unfortunately, when I try to merge the sample heightmaps together, I get this error: atMergeMap::MergeHF_UI error: - cannot initialise blend map.

I'm not sure what's going on.

I'm using the L3DT Standard 13.11 beta 1 version.
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Re: Stitching heightmaps together

Postby Aaron » Mon Feb 24, 2014 11:15 am

Hi bendragon1337,

Hmmm...I just tested it and it seemed to work normally. Can you please upload a screenshot of the 'merge heightmaps' window with your setting as entered?

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

Re: Stitching heightmaps together

Postby bendragon1337 » Mon Feb 24, 2014 12:20 pm

http://filesmelt.com/dl/Problem_Screenshot_1.png
http://filesmelt.com/dl/Problem_Screenshot_2.png

Hope this helps.

Added: When importing an additional heightmap, I wonder if there's a possibility to specify the height range of the newer tile so that L3DT can compare the new tile's height range with the existing height range, and adjust the brightness / contrast of the existing and new heightmaps accordingly to create an almost seamless terrain? :)

I notice that there aren't any settings for this that I can see in the windows that I am shown and I know for a fact that the way the heightmaps exported from the program I'm using, they take advantage of the entire 255 shade range, no matter what the actual terrain height is within the program.
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Re: Stitching heightmaps together

Postby Aaron » Mon Feb 24, 2014 1:18 pm

HI bendragon1337,

Oops, it seems I forgot to update a plugin in the installer. This bug was fixed a while ago.

Please download this update:

http://www.bundysoft.com/L3DT/downloads/plugins/bin/atEdgeBlender-bin.zip

To use the plugin, extract it from the zip archive and copy it over the existing plugin at:

Code: Select all
C:\Program Files (x86)\Bundysoft\L3DT [version]\Extensions\


As for setting heightfield tile altitude range in the merge window; good idea, I'll add this to the dev plan. As a work-around in the mean-time, you can try importing each heightmap tile PNG file into L3DT using the 'File->Import->Heightfield' menu option (in which you do have the option to set the altitude scaling), and then export the tile as a terrain format that stores the altitude scaling, such as HFZ, BT, TER, or HFF. When these tiles are loaded using the merge import function, the scaling will be handled correctly.

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

Re: Stitching heightmaps together

Postby bendragon1337 » Tue Feb 25, 2014 10:14 am

I've tried the new plugin, it still doesn't work.

Edit: That comes up with the same error too when I import the additional height map.
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Re: Stitching heightmaps together

Postby Aaron » Thu Feb 27, 2014 1:17 pm

Hi bendragon1337,

I sincerely apologise for this error. I've uploaded a new installer for L3DT Professional 14.02 beta 3 to the pro downloads page, which includes the latest atMergeMap plugin. I've tested this version of the plugin, and I can't seem to get it to fail. If you have less luck than I, can you please post the contents of the event log here, or else send the logfile to aaron@bundysoft.com. Please let me know how it goes.

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

Re: Stitching heightmaps together

Postby bendragon1337 » Fri Feb 28, 2014 12:51 pm

Unfortunately, I'm not using the pro edition, I'm using the free edition. :(
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Re: Stitching heightmaps together

Postby Aaron » Sat Mar 01, 2014 1:56 am

Hi bendragon1337,

As luck would have it, the beta release of the Standard Edition is now available too. Please let me know how it goes.

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

Re: Stitching heightmaps together

Postby bendragon1337 » Sat Mar 01, 2014 1:00 pm

It came up with a different error:

atMergeMap::MergeHF_UI error:
- cannot initialise blend map
- size = 256x512, TileSize = 512

I've E-mailed you the log file.
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Re: Stitching heightmaps together

Postby Aaron » Sun Mar 02, 2014 10:48 am

Hi bendragon1337,

Thanks for the error log. This was a subtle bug in the Standard edition, which explains why I couldn't reproduce it when I was testing in the Pro version. The fix is included in v14.03 beta 4, which is on the downloads page now. Please let me know if you find any further problems, and thanks again for your bug report and patience.

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

Re: Stitching heightmaps together

Postby bendragon1337 » Sun Mar 02, 2014 11:08 am

Well you've certainly squished that bug out. :) Now I can work on stitching the rest of the 132 heightmaps together.

Edit: It still bugs out with negative values. Positive values work though.

Addition: I am able to blend maps together, and I'm doing very well with it, but I'm having problems with height map height differentiations where differences are less then 1 meter, and the blending feature kinda ruins the proportions of the map.

Is there a possibility that when you "merge" height maps, that they get put in separate height field layers so you can edit the max and minimum height independently of each other while they're on the same canvas without disturbing the other canvases?
Last edited by bendragon1337 on Sun Mar 02, 2014 5:22 pm, edited 4 times in total.
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Next

Return to General discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron