Can we compile/create material instances with scripts?

I have a master material, with a bunch of static switch bool parameters. I need to figure out how to create a new material instance asset for each possible combination of static switch parameters.

The reason i need to do this, is because material options need to be exposed to the player, in-game. Usually I would use a dynamic material instance to change materials at runtime, however Static switch parameters cannot be changed at runtime. So i need to pre-make all the possible materials that can be made.

Not sure about the answer on your main question but maybe you can just use a scalar parameter instead of a static bool? Use 1.0 for true and 0.0 for false. It would also be best to clamp/ ceil/ floor its value. You might also consider using IF or LERP here, though, there could be some performance difference since, you might still operate both sides of the condition on runtime but I don’t think it is anywhere noticeable especially for simple operations. Hope that helps!

thanks for the suggestion, but this would indeed be too much of a performance hit for my material/target hardware.