Dark Terrain Seams

Morning all,

I’ve run afoul of an odd issue when using SetNeighbors to setup LOD on a matrix of 3x3 terrains.

What’s happening, is there are darkened areas where the terrains join, like so:

And my terrains are laid out like so:

Here’s my code for setting up the relationships as well:

function SetupNeighbours() {
	ter.SetNeighbors(ter2,ter4,null,null);
	ter2.SetNeighbors(ter3,ter5,ter,null);
	ter3.SetNeighbors(null, ter6, ter2, null);
	ter4.SetNeighbors(ter5, ter7, null, ter);
	ter5.SetNeighbors(ter6, ter8, ter4, ter2);
	ter6.SetNeighbors(null, ter9, ter5, ter3);
	ter7.SetNeighbors(ter8, null, null, ter4);
	ter8.SetNeighbors(ter9, null, ter7, ter5);
	ter9.SetNeighbors(null, null, ter8, ter6);
}

I’m pretty sure I’ve got them setup right - both the terrain layout image and the code is setup with X as north so the directions given to SetNeighbours should be correct. Does the function expect them from a different orientation (like X is east or something)?

The funny thing is that when I disable this function, the seams are invisible except in very few, hard to see instances (which has me considering going without for now).

Thoughts?

Thanks,
-V

Its possibly a problem with the Texture2D settings:

Look at the WrapMode, Iam sure there is the problem.

Unfortunately the texturing isn’t the issue - this occurs without textures applied and is resolved when I comment out the SetNeighbors calls. It’s definitely something with SetNeighbors, but I don’t know what.

-V

Ok, after finally getting back to this problem I’ve found that it appears to be something odd with the normals at the edges of unity’s terrain objects. If I don’t set the neighbours the seams aren’t dark - they’re light! Noticeably so too.

Is there a way I can manually set the normals on a terrain? I know you can use GetInterpolatedNormals to read them, but what about writing them?

Thanks,
-V

Did you ever find a fix for this issue? I stumbled onto this myself, and have been searching around.

I’m afraid I gave up on this and rolled my own terrain system.

For future reference: I think you are using the wrong direction on left, right, up and down.

Up is Z+, Down is Z-, Left is X- and Right is X+.