Why does my Switch Param in the material editor not work in post process?

Hello everyone. I’ve been doing some post process stuff but I’m having problems with StaticSwitchParameter. Look at this example:

6941-mat.png

Then I have a material instance and there I can enable and disable “EnableTest” and the color changes on the material preview. That material instance is applied as a blendable in a post process volume. However, in-game it only shows the color corresponding to the default value of “EnableTest”. Changing the value in the material instance does not have any effect in-game, only in the material preview. Other post processing stuff I’ve been testing worked fine in-game.

I’m missing something or is this a bug? Thanks.

Hey PacoChan -

How do you have your post process volume setup to accept your Post Process Material?

Switches are not supposed to be dynamic in nature. They are meant to control which of two choices are being rendered at compile time and the other side of the tree is ignored. If you want a setup like that which is dynamic in nature use a scalar parameter to LERP between the two options that way both sides of the tree are rendered and can be switched up dynamically.

Thank You -

Eric Ketchum

I’ll do it that way then. Thanks for your answer.

I’m also having similar problem. Chaning StaticSwitchParameter in the MaterialInstanceEditor does not affect anything…

That should work properly in the Material Instance, but because it is a Static switch you cannot change the value later on from a blueprint for example using a DynamicMaterialInstance. I too have had some issues with the StaticSwitchParameter though.

Try using a regular switch statement and plug in a StaticBoolParameter to change the value, I can confirm this will allow you to change from an instance as I use it in a few materials.

Hope that helps!

Unfortunately, using a Bool doesn’t work either when the material is used inside a Post Process. The only solution is to change it inside the material and recompile it it seems.

Also, the static switch setup or even the bool, doesn’t work in editor mode, so it’s not possible to easily preview a material using this setup, even if it’s not intended to be real-time changed.

So in essence, the preview mode doesn’t work in editor mode.