Unity generated mesh average normals on seperate vertices on same position/ smooth shade generated mesh

I have been following this tutorial from catlikecoding on a mesh generator and currently have this result.

I’m a beginner at all of this but i thought it would automatically smooth shade if i use RecalculateNormals() but i’m guessing it doesn’t work well because it’s all seperate vertices.

Would it make sense to create a seperate list of shared vertices and somehow find the normals per vertice cluster and average them on all? I can’t find a good way to approach that problem, so any hint would help greatly!

Here is what i have so far on the mesh generation

[NonSerialized] List<Vector3> vertices;
[NonSerialized] List<int> triangles;
[NonSerialized] List<Vector3> normals;

void Awake () {
    GetComponent<MeshFilter>().mesh = hexMesh = new Mesh();
    hexMesh.name = "Hex Mesh";
}

public void Clear () {
    hexMesh.Clear();
    vertices = ListPool<Vector3>.Get();
    triangles = ListPool<int>.Get();
    normals = ListPool<Vector3>.Get();
}

public void Apply () {
    hexMesh.SetVertices(vertices);
    ListPool<Vector3>.Add(vertices);    
    hexMesh.SetTriangles(triangles, 0);
    hexMesh.SetNormals(normals);
    ListPool<int>.Add(triangles);
    ListPool<Vector3>.Add(normals);
    hexMesh.RecalculateNormals();
}

public void AddTriangle (Vector3 v1, Vector3 v2, Vector3 v3) {
    int vertexIndex = vertices.Count;
    vertices.Add(HexMetrics.Perturb(v1));
    vertices.Add(HexMetrics.Perturb(v2));
    vertices.Add(HexMetrics.Perturb(v3));
    triangles.Add(vertexIndex);
    triangles.Add(vertexIndex + 1);
    triangles.Add(vertexIndex + 2);
}

public void AddQuad (Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4) {
    int vertexIndex = vertices.Count;
    vertices.Add(HexMetrics.Perturb(v1));
    vertices.Add(HexMetrics.Perturb(v2));
    vertices.Add(HexMetrics.Perturb(v3));
    vertices.Add(HexMetrics.Perturb(v4));
    triangles.Add(vertexIndex);
    triangles.Add(vertexIndex + 2);
    triangles.Add(vertexIndex + 1);
    triangles.Add(vertexIndex + 1);
    triangles.Add(vertexIndex + 2);
    triangles.Add(vertexIndex + 3);
}

Of course this won’t work. As you said yourself, they are seperate vertices. Why should Unity assume that two vertices which share the same position to be exactly the same in regards of normals? Also in order to do generate smooth normals one has to first figure out which vertices actually share the same position.

Apart from that, why do you generate an empty normals list which you assign to your mesh when you’re currently using RecalculateNormals?

Anyways, if you want smooth normals between your disconnected faces, you have to calculate them yourself. So you have to determine which vertices belong logically together, calculate the face normal for each of the faces that meet at that point and just calculate the arithmetic mean between those normals. That’s the normal that all of the vertices at that point would get.