x


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.

Thanks.

more ▼

asked Feb 11 '10 at 07:56 AM

Sandor Moldan gravatar image

Sandor Moldan
56 1 1 4

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Jul 20 '11 at 03:08 AM

novo gravatar image

novo
93 5 5 11

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Feb 11 '10 at 08:17 AM

Eric5h5 gravatar image

Eric5h5
80.3k 42 132 521

We're using a script to automatically subdivide a larger terrain into smaller ones (4, 16, 64, etc.). So the edge points all match up perfectly, but the normals don't, which makes the seam really obvious.

Feb 11 '10 at 03:20 PM Sandor Moldan

Is it to difficult to do that subdivision? Will you please publish the script which does that?

Feb 22 '10 at 10:43 PM Mike 2

Hi,Sandor Molda, can you tell me how to spilt the terrain?I have to generate a very big terrain at runtime, it is too big to show. i wanna to split it and dynamicly load it.Thanks

Jul 14 '11 at 11:47 AM Yanger_xy
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1477
x122

asked: Feb 11 '10 at 07:56 AM

Seen: 2251 times

Last Updated: Jul 20 '11 at 03:09 AM