My question is whether material instances are more efficient than materials? Do instances copy everything from their parents at run-time? If yes, how much time might it take? Does it even matter?
instances are just copies of masters with easy access to their variables.
time-wise and workflow wise its smart to use instances along masters.
performance-wise it does not matter unless you use a bleepload of static switches and randomly turn them off willy nilly per instance.
Hi. Thanks for your answer. Talking about “Static Switches” that you said, they’re not going to change at run-time right? So they’re pre-calculated before the game even starts. So, are you sure that it really does matter? Thinking about it this way, it’s going to be more optimized to recreate a new material from scratch or maybe the engine does it automatically for us. Meaning that no run-time calculations are going to happen and as it’s being said, “Switches are free at run-time.”.
not sure where you heard that because “This parameter is named static because it cannot change at runtime, it can only be set in the Material Instance Editor.”
This is because under the hood it will generate a new material when a static switch is ticked.
look at the static nodes here:
If you want some more in-depth optimization info, you can check this document I made a while back:
Edit: you could make a new master for each switch, but that can also increase time spend managing each master, especially annoying if you need to change the same values in each master.
Sure, a smart material editor person sets up material parameter collections for such things, but you’d need to know about them and prepare them ahead of time.