Multi meshes possibly share same shaderMaterial with different uniforms?

Hello everyone,
I’m wondering is it possible that I can make meshes with same shader but different uniforms using same shaderMaterial? I have to produce thousands of meshes at the same time, it will stuck for a long time when creating the meshes.
Or is there any other ways to make the buildings’top in the pic with single material(maybe change uvs, but I just cant imagine how to do this)? I want to make it looks like outline0F2633A8-E5C0-4ad0-ACF3-9A39DEB3ED5F

You can update a uniform in the shadermaterial.onBindObservable observable:

shadermaterial.onBindObservable.add((mesh) => {
    if ( === "xxx") {
        shadermaterial.setFloat("myuniform", 1.2);
    } else if ( === "yyy") {
        shadermaterial.setFloat("myuniform", 1.7);

It seems that the shader uses the last update of uniform, could you please point me out where is wrong?

My mistake, in the onBindObservable you must directly update the value on the effect, not on the base class:

It works! Thank you so much for helping me out!!