Tile lighting issue

Hello,

I am working on a custom tile-based terrain editor

I am trying to achieve something similar to this:
100760-capture.png

What I currently have is this:
100761-capture2.png

In my version you can clearly see each tile because of the lighting. how do i solve this ? does it have to do with lightmaps or normals?

Currently, after I raise the verticies of a tile, I do the following:

Mesh.Clear();

        TopLeft = v3helper.ClampVector3ToMaxHeight(TopLeft, maxTileHeight);
        TopRight = v3helper.ClampVector3ToMaxHeight(TopRight, maxTileHeight);
        BotLeft = v3helper.ClampVector3ToMaxHeight(BotLeft, maxTileHeight);
        BotRight = v3helper.ClampVector3ToMaxHeight(BotRight, maxTileHeight);

        Mesh.vertices = new Vector3[]
        {
            TopLeft,
            TopRight,
            BotLeft,
            BotRight
        };

        Mesh.uv = new Vector2[]
        {
            new Vector2 (0,1),
            new Vector2 (1,1),
            new Vector2 (0,0),
            new Vector2 (1,0)
        };

        Mesh.triangles = new int[] { 0, 1, 2, 1, 3, 2 };

        Mesh.RecalculateNormals();
        Mesh.RecalculateBounds();
        



        MC.sharedMesh = Mesh;

Thanks!

I got it working. I will leave the answer here in case someone finds this.

For each tile, I was creating 4 verticies which means the verticies of the inner tiles were duplicated and each tile was kinda like its own isolated mesh of 2 triangles that were not linked to anything else( even though it looked very much like it was :slight_smile: ) . Threrefore the normals were not calculated properly.

Now the shadows are smooth as I was hoping for :slight_smile:100778-capture.png