Changing material properties using mesh instances

I’m try to do some optimization on my project, and I found that I have the same material imported MANY times, which seems very inefficient.
I have many of the same meshes with the same material, but with different material properties(uvScale, uvOffset etc).
I have not found a way to adjust the material without using .clone(), but surely this is causing some performance hindrance if each mesh gets a unique instance of the same material?

https://playground.babylonjs.com/#9S48TN#1

The thing is as long as their properties are different, they need to be clones. Instances are all drawn in one command so they can not have different properties.

1 Like