Individual value of material instance parameter on separate mesh.

I have a bunch of same meshes spawning at runtime and sharing one material instance.
As expected, changing parameter of instance makes effect on all meshes.

How can I change that material instance parameter individually for only one of these meshes? Individual material instance for each mesh is not possible in my case, because there can be hundreds or thousands of them.

Ok. It looks like only individual material instance for separate mesh will work my way.
Interesting to know, how ten separate material instances affects the performance compared to only one instance?

Ok, there is a way.

Make a Blueprint with your static mesh as a component. Within the construction script create a DynamicMaterialInstance (there is a node with similar name) and apply it to your static mesh. Now place instances of this Blueprint in your map and each of them will have indepedant material properties.

Yes, that is right and only way to achieve what I need. But how drastically it will affects performance?


This don’t really work. Did someone have found a solution?
I have try with a material and the “PerInstanceRandom” to make 3 vector color.

But with that I have only got one vector so I need a solution!

Thanks for people will try to help me :slight_smile:

Using dynamic material instances didn’t affect framerate to much. What you should be thinking about, is what kind of meshes you are using. Thousands of Static Meshes will definitely hurt your performance a lot. Using Instanced Static Meshes will definitely help.