How To Adjust Object Mesh UV Without Increase DrawCall?

Hello,
I’m trying to make a game where hundred of cubes generate on runtime, each might have different UI. So I’m using atlat texture to combine the ui and try to manage it by uv (because using material offset will create new instance). As they are all shared material, which is set with Enable GPU Instancing, I can see the drawcall keep even more cubes are create on runtime. However when I change the cube uv, somehow the drawcall increase, and even set MeshRenderer with the same material instance, nothing is work.

How can I change uv for each instance but still able to keep the drawcall at low?

    public void UpdateTileUI(TileType type)
    {
        var meshFilter = this.GetComponent<MeshFilter>();
        var newUvs = UpdateUvsByType(meshFilter.sharedMesh.uv, type);
        meshFilter.mesh.uv = newUvs;

        //var meshRenderer = this.GetComponent<MeshRenderer>();
        //meshRenderer.sharedMaterial = GlobalResource.AtlasMaterial;
    }

Thanks,
Leon

Unless I’m mistaken, accessing meshFilter.mesh should create an UNIQUE mesh assigned just to that mesh filter, which will increase drawcalls.

Actually, you need to try altering material parameters, but do that through:MaterialPropertyBlock.

See this article (might need updating to current api):
https://thomasmountainborn.com/2016/05/25/materialpropertyblocks/