Material Bool in Collection Parameters/Material Function?

Maybe I missed something but is there a way to connect a static switch to a collection parameter or change it by code/blueprint in a material function (not a single instance, all at once)?

It would be nice to toggle some effects like displacement for walls or something like that or even switch between a cheap and a expensive node tree without editing each material to adjust the quality switch. I want to achieve the most optimized performance for the final in game settings so it would be a lot of work in my opinion to tweak the performance by using quality switch.

It would also cool to use for some effects, like a super vision (looking through walls, thermo vision…) or something like that.

Are there any plans for such a feature?

Thanks in advance,
NaMJaG

Hey NaMJaG -

Static Switches are primarily used for Material Instant Constants (created in the Content Browser). So you could create two material instant constants based on a master material controlled by that static switch, then change the Material Instance Dynamic (MID) in a Blueprint to be MIC #1 then MIC #2 through a Set Material node in Blueprint.

Let me know if you need further explanation -

Eric Ketchum

Ah static switches require a material instant constant resulting in a new shader.
So even if I could control a static switch of more than one material at once through a Collection Parameter or a Material Function it wouldn’t have any effect because the shader doesn’t recompile. A simple “if” node combined with a collection parameter is the best way to toggle effects in game on a bunch of materials in one step, but when it comes to rendering it calculates the whole tree so there wouldn’t be any performance changes if I toggle effects with a collection parameter.

Now I think I understand how the static switch really works (or am I wrong?)

To make it easier to tweak the performance and toggling effects I would need a feature to edit a static bool parameter in all selected Material Instant Constants. (If I open multiple material instances at once (select them + press enter) I am able to change font, scalar, texture and Vector parameters in one step by adding them to the list and changing the value but I can’t change booleans)

I think editing multiple material Instances at once sounds like something I could achieve with a plugin or maybe there will be an update witch improves the possibility of editing multiple material instances in the generic editor.

For in game changes I’ll use this super awesome collection parameter system.

Thanks for the help!