L3DT users' community
Large 3D terrain generator

Seams in stiched Terrains

Got a problem or need advice?

Seams in stiched Terrains

Postby Onkelpoe » Wed Sep 17, 2014 3:04 pm

hello,

I am just a new user - so please bare with me...


I got some heightmaps from WM2, exported as .TER files and imported into L3DT for blending them together.
In Sapphire View, everything is 100% ok - but when exporting them as .raw tiles for import into Unity 3D, the terrains got seams :(

Does anybody know the correct workflow, here?

I want to blend four 2048 by 2048 heightfields together (which I manage ok, thanks to the wiki) to get one seamless terrain, that I want
to export as 4 tiles again -- 4 tiles which should perfectly match at borders...

I wanted to add images here.. but 256kb size-limit? Come on... bandwith is not that expensive anymore ^^

Cheers!
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby Aaron » Sat Sep 20, 2014 2:59 pm

Hi Onkelpoe,

Welcome to the forum, and sorry for my slow reply. I'm working on a fix for this problem now, I'll post back here when an update is available (next day or so, I expect).

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

Re: Seams in stiched Terrains

Postby Onkelpoe » Mon Sep 22, 2014 1:12 pm

hey, this would be sweet!

Best Regards
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby ShadowIce » Tue Sep 23, 2014 2:48 am

I third, fourth, and fifth that.
ShadowIce
Luminary
 
Posts: 76
Joined: Fri Aug 05, 2011 6:11 pm

Re: Seams in stiched Terrains

Postby Onkelpoe » Fri Sep 26, 2014 9:11 am

Ok, please see:

I imported a 8192x8192 .ter heightfield and generated Terrain-Normal map, exported 16 2049x2049 .raw heightfields and 16 2048x2048 normal maps.
(I generated also 16 obj meshes from the heightfields)

Now, when importing the meshes into Unity 3d 4.5 and apply the normal-maps (whicht suprisingly seem to be in OpenGL and fitting into Unity Tangen space system) - or am I wrong?

Anyways, when importing and placing mesh next to mesh, I am getting visible seams (see Image). I think the problem ist, that L3DT ist only "cut out" the 2048x2048 normal maps
from the 8192 normal map, but without regarding, that the normlas must have an Pixel-overlap (for example, if a heightfield is a 256x256 pixel the first tile will need to cover pixels 0..128, while the second will need to still include pixel 128 and go to 255)

Any workarounds?

Cheers!
Attachments
seams.PNG
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby Aaron » Sat Sep 27, 2014 12:12 pm

Hi Onkelpoe,

I'm sorry for my slow reply.

Firstly, have you tried L3DT's OBJ mesh exporter? It also exports tiled sets of optimised OBJ files along with the normal and texture maps for each tile, including the overlaps to join up neighbouring tiles. You can get to it using the 'File->Export->Export optimised mesh' menu item. Be sure to select the normals map layer under the auxiliary map option.

The other way to get what you want from L3DT is to use the 'duplicate tile borders' function to re-pack the tiles of the normals map so that the last row/column in each tile matches the first row/column in the next tiles. To do this, you'll first need to make sure you're using the latest build (v14.09 Pro beta 5). Then, select the normals map in L3DT ('Terrain normals' tab), and select the 'Layers->Mosaic->Duplicate tile borders' menu option. You'll be asked to enter the desired tile size (2048, in your case), and thereafter L3DT will repack the normals map for you, and you can then re-export the normals map and the tiles will line up. However, before you do this operation you may wish to back up your project, as the normals map in the project will be changed by the operation.

Please let me know how it turns out.

...whicht suprisingly seem to be in OpenGL and fitting into Unity Tangen space system - or am I wrong?


L3DT uses the so-called 'right handed coordinate system', just like OpenGL.

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

Re: Seams in stiched Terrains

Postby Onkelpoe » Mon Sep 29, 2014 7:41 am

Ok, so I tested the 1st part (exporting optimized .OBJ + normal tiles) - but can not archiveve seamless borders... One thing, I think is a bit strange: I set 2048x2048 size and get (4x4) tiles.
But somehow some of the normal maps are 2048*2049 or 2049*2048 - but the heightfield is 8192x8192 so the tiles should be 2048x2048 - but they don´t!
(see image for used setting, L3DT PRO Version: 14.06 Pro RC 3)

edit: tried with "resize to nearst power of 2" - but still seams...


The mesh-optimization works great - it conserves details and shapes much better, than the simple reduction in WM! Very well done!!
- but still -no perfectly tiling meshes/terrains in Unity 3D...


Later, I´ll try the other option, after I downloaded the latest build... Man, I really hope this works - L3DT would be a real timesaver-tool for me, then ;)

edit2: What´s also kind of strange: do the meshes have "offsets applied?" When I am placing mesh1 at xyz (1,1,1) and import the mesh, that is next to mesh1 and place it also at (1,1,1), the meshes lie side by side. Normally the should lie it the same place, because they got the same coords!


Cheers and thanks for support!
Attachments
settings.PNG
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby Onkelpoe » Mon Sep 29, 2014 5:25 pm

hey,

installed the beta version, like you said - I imported a heightfield(.ter format) and want to generate the terrain normals of it, which
results in an error:

CMapGroup::AutoInitTN error
- Group name is invalid
calc_TN_GenMap error
- cannot initialise map
CMapGroup::AutoInitTN error
- Group name is invalid
calc_TN_GenMap error
- cannot initialise map

So I can not test, if it works :(

So I imported my normal map as "Texutre map" an going thru the steps, you mentioned. After repack, I exported the map as 2048x2048 mosaic tiles...

Will test tomorrow, if normals will make seamless, now!
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby Onkelpoe » Tue Sep 30, 2014 6:29 am

Ok - this test also failed (see image, it is very close up).
I did like you suggested (because of the error, I did not let L3DT calculate the normals, I took a pre-made normal map instead) - but no difference.

Still got visible seams (the more you are "right above, topdown", the more you can spot them. Only from some angles, the are invisible.

Best regards
Attachments
seams.PNG
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby Aaron » Tue Sep 30, 2014 9:39 am

Hi Onkelpoe,

Thanks for the bug report. I'll fix that for the next build. In the mean-time, you can work around the problem by saving the map project in L3DT after you import the heightfield and before you generate the normals map. 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: Seams in stiched Terrains

Postby Onkelpoe » Tue Sep 30, 2014 11:19 am

Hey Aaron,

thanks for quick reply! Sure, I´ll test it and report back in a couple of hours..

Kind Regards
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby Onkelpoe » Wed Oct 01, 2014 6:20 am

Here we go: The workaround you suggested in your last post acutally works! Now I can generat a normal map in L3DT - but after 'Layers->Mosaic->Duplicate tile borders'
and 'Export Layer->Mosaic->2048' the seams are still there.

One thing is indeed different, than before: I noticed some "lines" on some of the normal maps. It seems, like L3DT does some "splitting" or something the like - but not
in the right places, when setting "2048" for the duplicate tile borders.

The snipped from one of the 2048x2048 normal maps shows a "line" right in the middle of the image...(at 1024)

Any clues?

edit: Oh and these "lines" show up on "Textures" as well, when 'File->Export->Export optimised mesh' and Texture was used as aux. map....

edit2: When importing the heightfield and go "Operations->Terrain Normals", setting "1px ratio" and "uncheck tiling/mosaic" the resulting normal map already get some "lines" on it.
It looks (partly) it will be a 1024x1024 raster (!) but it seems to appear mostly in the upper half of the map (!) It is hard to spot, but it´s there...

edit3: Seems, this issue only appears, when using a 8192x8192.ter heightfield... the same heightfield, just in 8193x8193 does not show this "lines", when generating a normal map (!)
edit4:But when trying to generate 'Layers->Mosaic->Duplicate tile borders' , L3DT keeps on crashing...
Attachments
texture.PNG
what.PNG
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby Onkelpoe » Mon Oct 06, 2014 6:33 am

/push - Really need to get this solved, please!

tried on another PC with a different hardware - also crashing...

Code: Select all
  Problemereignisname:   APPCRASH
  Anwendungsname:   L3DT.exe
  Anwendungsversion:   14.9.1.5
  Anwendungszeitstempel:   5422b234
  Fehlermodulname:   StackHash_ae2b
  Fehlermodulversion:   6.1.7601.18229
  Fehlermodulzeitstempel:   51fb1072
  Ausnahmecode:   c0000374
  Ausnahmeoffset:   000ce753
  Betriebsystemversion:   6.1.7601.2.1.0.256.48
  Gebietsschema-ID:   1031
  Zusatzinformation 1:   ae2b
  Zusatzinformation 2:   ae2bf4bd05b9953c3486b8b5b39c023e
  Zusatzinformation 3:   ddbf
  Zusatzinformation 4:   ddbf8a68f4f174c5c3af9e40109bc6cb



... here is the crash-detail-report - maybe this helps?!
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Re: Seams in stiched Terrains

Postby Aaron » Mon Oct 06, 2014 3:20 pm

Hi Onkelpoe,

I apologise for the delay in my reply. On the pro downloads page you will now find the installer for L3DT 14.10 dev build 1, which should fix some of the problems you're finding, and help me debug the other problems.

Firstly, you now don't need to remember to save the map before generating the normal map.

Secondly, I can't reproduce the crashing fault, but the new build includes some logging that should help me find out what's going wrong. Please run it, and after it crashes, send me the log file (to aaron@bundysoft.com). You can get to it using the 'All programs->Bundysoft->L3DT [version]->L3DT logs' shortcut in the Windows start menu. That link will open a directory in which you will find a file called 'log.txt'. With the logfile, I should be able to work out what is going wrong.

I've still to work out the full procedure for you to avoid the seams, but I'll try to get that sorted in the next day or so. The important trick will be to use the 'duplicate tile borders' option after you export the optimised mesh (not before), and then copy the re-packed normals / texture / etc images over the images exported with the mesh file. I'll try to work out a more complete step by step set of instructions for this procedure ASAP, and if it works, I'll modify the mesh exporter to do this all automagically. Sorry again for the delay.

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

Re: Seams in stiched Terrains

Postby Onkelpoe » Tue Oct 07, 2014 6:42 am

No problem, I am glad to get support and you´re want to solve this issue, maybe as much as I do.

Will report back, when installed and tested with the latest build...

Cheers!
Onkelpoe
Contributing member
 
Posts: 43
Joined: Wed Sep 17, 2014 2:50 pm

Next

Return to Help and support

Who is online

Users browsing this forum: No registered users and 9 guests

cron