Download

Dynamic Materials without Dynamic Material Instances

I recently discovered that if I call the node ‘Set Scalar Parameter on Materials’ that is available in a Static Mesh component - I have the ability to adjust individual scalar parameters for a mesh without first creating a Dynamic Material Instance. The material applied to the mesh should of course already support the parameters you want to adjust of course. It appears that the engine is automatically creating Dynamic Material instances at runtime in order for this effect to work. Is there any drawback to this approach? Are any of my assumptions/finding incorrect? Any insight by the experts would be appreciated.

I would say its slightly less efficient because when you call it, it is doing checks to make sure the material is dynamic every time you change the values with that function (then checking if that parameter exists, and finally changes it). Where if you have a pointer to a DMI and change the value from there, it only makes sure the parameter exists then changes it.