What is the correct use of the Terrain.SetNeighbors() method?

We're working on setting up a 'seamless' game world where the world is split up into smaller terrain blocks in individual scenes which are dynamically loaded and unloaded.

We're running into problems with the Terrain.SetNeighbors() method which should correct the rendering of normals at terrain seams as well as match up LOD.

We have followed the documentation which says that neighbours must be set on both adjacent terrain objects, which we have done, but are still seeing incorrect normal rendering and 'tearing' at terrain seams at a distance where the LOD does not seem to match up.

Could someone please confirm what the correct usage is for this method, preferably with working sample code.


I was experiencing a similar issue: SetNeighbors() was being called correctly, but I was still getting incorrect normals at terrain edges. After digging through the API docs I realized I needed to call Terrain.Flush() after the SetNeighbors operation.

As far as I know, SetNeighbors only matches up LOD and not normals; for that you have to adjust the heights of both terrains to match.

Something new for this question? I have same problem. My Terrains have absolutly same heights at connected sides (adjusted programmatically in C# script) and I called SetNeighbors() for both sectors.

But when I switch Scene window Shading Mode to Shading Wireframe I can see, that there are different LOD sometimes. Not always, but only for some camera distances.

Different normals along terrain sides are problem also. Even if the heights and LOD are same, the seam is clearly noticable because different normals. Is there some way how to programmatically edit normals (like height map)?

Some simple example how to correctly join two terrains would by cool! really!