I asked this question on Unity Answers but there hasn’t been a single answer, so I’m posting it here:

I’ve got a script that generates a procedural mesh and then splits the edges to make it flat shaded, but there’s a problem when viewing it.

There are these seams that are visible at the edges, and when viewed from a distance, cluster together to make a white/yellow hue on the entire mesh.

Here are some pictures:

```
Mesh mesh = meshFilter.mesh;
Vector3[] vertices = mesh.vertices;
for (int i = 0; i < vertices.Length; i++) {
float xCoord = Mathf.Abs((transform.position.x + vertices[i].x) * scale)-5000;
float yCoord = Mathf.Abs((transform.position.z + vertices[i].z) * scale)-5000;
vertices[i].y = (Mathf.PerlinNoise (xCoord, yCoord) - 0.5f) * power;
}
meshFilter.mesh.vertices = vertices;
meshFilter.mesh.RecalculateBounds ();
meshFilter.mesh.RecalculateNormals ();
// split edges
Vector3[] oldVerts = vertices;
int[] triangles = mesh.triangles;
vertices = new Vector3[triangles.Length];
for (int i = 0; i < triangles.Length; i++) {
vertices[i] = oldVerts[triangles[i]];
triangles[i] = i;
}
mesh.vertices = vertices;
mesh.triangles = triangles;
mesh.RecalculateBounds();
mesh.RecalculateNormals();
meshFilter.mesh = mesh;
meshCollider.sharedMesh = mesh;
```

I’ve searched through existing questions for quite a while, and I haven’t found anything.