Procedural Terrain / Delaunay Triangulation - Problem with Chunks!

Hello everybody,

first i want to show you my actual terrain generator with a custom “Vert Reduction Algorithm” and the “Delaunay Triangulation Algorithm” implemented.

As you can see the chunks have got some issues in the corners and sides.
I’ll explain it a bit.

The problem that i have is when i do the vert reduction and after that the delaunay triangulation… so some vertices don’t match on the neighbor chunks.

My solution that i think will solve this problem is to generate the normal grid… set some noise heights, do the vert reduction and after that i could write all left vertices in a global array and do the triangulation.

Anyway… my question: “Is there a better/faster way to solve that or not?”

Thanks :wink:

Bg
Alex

Does really nobody have an idea? :confused:

Without any code being posted, I’m not sure what anyone can say except “hey, that’s some nice hills you got there buddy.” And they are nice, but I see the little clefts/ripples you mention, apart from the low-poly faceting going on.

If you’re having trouble getting a particular geometry to look good, like those little “clefts” that appear, you could perhaps isolate that piece of ground (by discovering what input X and Z you are dealing with) and make a very small piece of geometry, then use something like the ExportObj.cs script (on the Unity wiki) to export it to an OBJ file, then bring it into your favorite 3D program and study how things are connected, to understand exactly what your code might be doing wrong.

Oh also, on the “some vertices don’t match” issue, float numbers often do not match as in “be the same via the equality operator.” Look up “floating point precision error.”

Because of this, it is often necessary to define an epsilon “error factor” that is “close enough” (perhaps 1E-5 or so) and use that in your own equality operator, and say that if the distance from v1 to v2 is less than epsilon, then it is the same vert already.

1 Like

You appear to be doing the vertex reduction separately on each chunk, and your problem is that it doesn’t do the same reduction on points that are shared on chuck edges. An easy fix might be to not remove vertices if they lie on a chunk edge. Otherwise you will have to make sure the vertices on chunk edges match. You could either add in all edge vertices from the chunk along the shared edge, or perhaps move vertices along the edges until all vertices along an edge are coincident with vertices along the same edge of the other chunk.

1 Like