Hi everyone, I am trying to find a way to change a postprocess material instance’s Boolean (True/False) by using blueprints. Basically I want the user to be able to change this whenever they are in the graphics settings. However, I am having a difficult time at attempting a way for a blueprint to communicate with a material. I have tried using material parameter but I am not sure where to go beyond that. Basically when my user clicks the graphic setting button it gets the current material parameter value and adds one. This will then be read and decide whether it is 0 = False or 1 = True. Mind helping me out in this, thanks!
I’m not sure that you can change this dynamically. Its a static switch that actually reduces or recalculates all instructions for the material. other material branches that can be adjusted at run time need to calculate both possible paths and then discard one or the other (keeps instruction # the same across all pixels). From the Documentation on Static switch:
This parameter is named static because it cannot change at runtime, it can only be set in the Material Instance Editor. Static Switches are applied at compile time, not at runtime. This means that whatever branch of the material was dropped will never be executed, so static switches are effectively free at runtime. On the other hand, a new version of the material must be compiled out for every used combination of static parameters in a material, which can lead to a shader explosion if abused. Try to minimize the number of static parameters in the material and the number of permutations of those static parameters that are actually used.
https://docs.unrealengine.com/en-US/RenderingAndGraphics/Materials/ExpressionReference/Parameters/index.html
You can always get around this potentially if its a major concern by swapping the material (instance) used in the post process at run time, that’s completely fine.