Perfectly tileable terrains : is it really possible ?

Has anyone succeeded in assembling multiple terrains with totally invisible tiles ? I’m not speaking of the texture part that uses SetNeighbor, but of the geometry. If someone has a reliable pipeline to share…

We have some success in doing this. We have multiple terrain tiles that are connected together to create a really long terrain with winding roads on it.

The way we did this is we used Photoshop to create the heightmaps that the terrain start from. We keep the height of the terrain on the edges to be completely white or completely black (white represents the highest possible height and black represents the lowest possible height on the terrain) and then inside unity use Terrain Height parameter to actually tell unity what height the white color represents. If you set it to 600 for example - you actually tell Unity that white means 600, black is 0 and any gray shade in between is between 0 to 600 in proportion.

As long as you keep the edges white or black you can edit anything inside the terrain as you like. Theoretically you could also use some gray value that will be the same on both tiles, but it’s much trickier to do so.

The only downside is that the “seams” between the terrains pretty much have to be flat, with no slope what-so-ever.

Oh, and SetNeightbours() is necessary not only in the texture part. It recalculates the normal at the seem thus fixing how the light behaves there and makes the difference between “Almost invisible” and “Where was that seam again?..” :slight_smile:

We did some tests to see if we can chop up an already created and textured terrain to multiple tiles and had some success but there were some kinks that we didn’t have the time to figure out how to fix, and building each tile separately was something we could live with.

Thank you for your answer. What you describe in your second experience seems similar to mine : if I generate a big terrain in L3DT and export it as several tiles to the RAW format, none of the terrain objects will have a geometry that fits perfectly with its neighbors, even if I set pixel error to the minimal value and make use of SetNeighbor. I suppose it is related to the terrain mesh resolution, but I wonder if it would be possible in a future version of Unity to compensate this limitation by computing the edges even more, so that they stick better.

Meanwhile, the formula you suggest is very smart indeed, since it doesn’t limit the altitude the transitions’ altitude to zero. Thanks :smile:

Hello, Yann.

I also had issues with getting L3DT terrains into Unity. I attributed it to my lack of understanding and a difference in nomenclature between the two products. What was exported from L3DT never ended up looking the same in Unity. More often than not, it would be a terrain filled with stalactites or some such! I imagine your seam issues with the tiles is similar.

Photoshop didn’t appear to like the RAW images that came over from windows either.

I never had time to fully work through all the issues. Hope some eventually does, L3DT would be a great tool for unity developers.

Just to make it clear - I beleive you could definitely achieve splitting a terrain you exported from some program into unity into smaller parts and making it connect seamlessly.
You just have to know exactly what you’re doing to avoid the little quirks that will cause those artifacts or miss-alignment issues. In our example we had maybe a one or two pixel miss-alignment in the area of the seams, and I believe it was due to minor errors in calculation… For example the fact that a height map is not even but odd (1025 pixels instead of 1024) caused us to calculate the width and height of each part incorrectly.
This issue would be irrelevant if we wrote a script that did the splitting of the height.

We experienced some of those glitches that cause the terrain data to import incorrectly, but we found a solution to every single of of them!

We came very close to making it work. Just didn’t have the time to make that extra effort to make it work 100%. Without a script doing the procedure we would just have been opening a door for mistakes.

you do realize that in order to make the terrains from L3DT show up in unity correctly there is a setting you need to change. (read the documentation there is a setting which will make them flat at the point of connection for mosaic tiles :slight_smile: )

Hi Quietus,

I remember having similiar problems a few month ago.

Are you sure you set the “byte order” while importing the RAW Map in unity to PC ? I just made a test with a PC L3DT Testmap, exported it to Mac as a .raw file and imported it into Unity with PC “byte order” / “16 Bit”. It worked here for me.

If you have Photoshop on both Mac and PC installed, you might try to open the exported .raw file first up in Photoshop PC, save it there to Mac as a .psd file and finally open it on Mac PhotoShop. Save it there again as a Mac .raw file . As far as I remember correctly, this way worked perfectly.
(using Mac “byte order” of course)

If not, please let me know, I’m sure I can help you.

–
oxl

hey, let them read the documentation where it tells them that :slight_smile:

Actually, my intention is to help someone, if I am able to.

–
oxl

same here but there are other things in there which are useful to know and I was being sarcastic about letting them read the documentation

Hello oxl,

Thank you for your input.

It’s been awhile but iirc it was mostly an issue of scale when importing into unity. I remember not being able to tie the parameters in the unity terrain directly to their equivalents in L3DT. Something about the height resolution. I therefore somehow consistently ended up with cones and spikes where there should have been mountains!

It was my intention to use some simple photoshop techniques to carve roads into an L3DT generated raw file, something I used to do on torque atlas files with great success. However, on top of the nomenclature/parameter matching issue, my Mac version of photoshop didn’t appear to like the PC RAW file at all.

It was not related to any of my current projects, just curiosity, so I only spent a couple days toying with it. I had just wanted to see if there was a viable workflow to use L3DT with Unity, as both are such stellar products. If you have one, I’m sure myself and others would love to see a Wiki article about your experiences.

Yes, I was confused, too , so I adjusted the import values in Unity as long as they fit into my needs.

That was the reason I went the way through PC Photoshop exporting first.
I also would be glad to have same other formats than .raw available for importing.

If I’ll find the time again to experiment with L3DT ,I’ll let you know :slight_smile:

@Yann: Sorry for highjacking your thread a bit :sweat_smile:

–
oxl