L3DT users' community
Large 3D terrain generator

Stitching heightmaps together

Any and all chit-chat regarding L3DT.

Re: Stitching heightmaps together

Postby Aaron » Sun Mar 02, 2014 11:20 am

Hi bendragon1337,

Umm...L3DT Standard has a heightmap size limit of 2049x2049 pixels, so it'll only do 8x8 of your tiles (see here for a comparison of versions). I think you might need to register for a free 90 day trial of L3DT Pro (see here).

Cheerio,
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 8:43 pm

Thanks for that notification, I'll keep it in mind.

Added:

I wish there were better ways to match the height of existing terrain with neighbouring tiles, compared to just specifying the max and minimum height tiles.

During my project, I found out that using the highest and lowest points where you merge the height maps together using the highest and lowest points is a little bit unpredictable and "blending" doesn't really help much with matching of the 2 tiles.

What would be good, would be if you could specify, graphically, which edge of the tiles you wanted to "pair" up with each other when it does merge, so when it comes to merging, the height map's contrast / brightness would be adjusted to get a finish that would almost be seamless, results would vary depending on the method you choose.

Now that I think about it, There would be different types of merging, there would be:
  • Point - based - Specifying 2 points manually along an edge which would denote the highest and lowest points on that tile's edge would generate 2 points on the new tiles based on position and offset, upon merging, the brightness / contrast of both maps are altered to give excellent usage of the 255 range (this would only apply if the new tile turned out to have points higher then the existing tiles, as it would produce a hight beyond the 255 brightness range), a larger height range between the 2 points would create more accurate mapping.

    Point mapping would cause the edge in-between to have a seam, unless the maps were matching before hand.
  • Linear (edge-based) - where it adjusts the brightness / contrast based on a row of pixels on the edge of the new and old tiles and it would adjust the row of pixels along the edge to try to get a seamless edge as possible.
  • Original - which would be specifying the highest and lowest points on the map, and it would blend the maps according to the ultimate max range.

Attached is a screenshot showing the progress I did on my map, more detail on why I marked points in red and edges in blue is in the attachment's description.
:)
Attachments
Vale Rale A3 to A6 Example.png
The blue lines are an example of where edged-based merging can be used, the red points is an example of where Point-based merging can be used, keep in mind this was merged using the original method and not the method I have suggested, this is only an example.
Vale Rale A3 to A6 Example.png (81.71 KiB) Viewed 16225 times
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Re: Stitching heightmaps together

Postby Aaron » Wed Mar 12, 2014 11:46 am

Hi Bendragon1337,

Sorry for my slow reply; I didn't notice your edit, as the forum software doesn't put post edits back into the RSS feed.

This could perhaps be done by a script, or else directly in the import merge plugin. I'll have a bit more of a think about it.

Can you please send me two adjoining tiles so that I can test the import? (to aaron@bundysoft.com please).

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 » Wed Mar 12, 2014 3:11 pm

I sent 2 + 1 tiles to demonstrate the various problems I could come up against.
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Re: Stitching heightmaps together

Postby Aaron » Mon Apr 14, 2014 3:31 pm

Hi Bendragon,


Sorry for the delay. I've been working through some other bugs in L3DT 14.0X, and I guess I overlooked your request until just now. I've added a linear regression calculation to the edge blender plugin which automagically re-calculates the min/max altitude for each tile and scales them appropriately. Here is the before and after effect on the three tiles you sent (A5 is in the bottom-left corner of the screenshots):

Before:

ValeRale_A3_to_A5_before_800.png
Before
ValeRale_A3_to_A5_before_800.png (100.65 KiB) Viewed 16151 times


After:

ValeRale_A3_to_A5_after_800.png
After
ValeRale_A3_to_A5_after_800.png (109.16 KiB) Viewed 16151 times


[Note this calculation does nothing to fix the rather obvious stair-stepping terraces in the height data caused by them having been in an 8-bit image format. I know of no good/easy fix for that problem.]

You can download the updated plugin from here:

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

To use the new function, first copy the plugin over the existing ZEO file in the extensions folder, then start L3DT and use the import merge option to load all the heightmap tiles into one big (don't bother changing the vertical scale of the tiles at this point; it's unnecessary). Finally, select the 'Extensions->atEdgeBlender->Linear regression of tile scaling' menu option. In the settings window you'll have to set the TileSize_px setting to 256 and the BlendDepth_px setting to 32 for your map.

Please let me know if you find any problems.

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 Apr 14, 2014 4:20 pm

Don't worry about the stepping, you've managed to solve the problem perfectly, thank you. :)
bendragon1337
Member
 
Posts: 19
Joined: Thu Feb 20, 2014 11:27 pm

Previous

Return to General discussion

Who is online

Users browsing this forum: No registered users and 13 guests

cron