How do I change the settings in blueprints for a smooth transition with shaders?

I have a post process material set up (shown below) and I’ve been wondering how I could either change the scalar parameters in blueprints (because changing the slider in post process settings is not smooth enough, 0 is nothing and .1 is all of it).

Hey there @MICHAELMIKEYMAN! Welcome to the community! So looks like you need Dynamic Material Instances. These are the only way to modify these values at runtime other than just during construction. So first off you make your material, in my case I just have some panners hooked up haphazardly to shift the UVs here.

I have 2 params there, X and Y.

Now I’m going to make a material instance of the material we want to play with.

Make sure your params are visible here:

image

then apply that instance to your blueprint object, in my case it’s just a sphere.

Then create some variables (preferably public so you can play around in editor), then we make a dynamic material instance, set it’s parameters, and apply it to the object in the construction script.

This gives you free reign on the material itself in blueprints at runtime.

I use BeginPlay as an example function and set them arbitrarily here, but you can create a timeline for the alpha of your extended lerp (assuming you want it based on time) or however you want to work with that logic! You also could skip the Dynamic material if what you need to do can be done in constructor and you don’t want to edit the values at runtime individually per instance.

UnrealEditor_2022-09-02_03-57-27

And voila, your material can be adjusted whenever however.

Let me know if you have any questions!

Thank you. I understand what you have explained but my issue is that the material is not really bound to a mesh, it’s bound to my post process volume as a post process material so I was wondering how I could alter the scalar parameter of the instance completely on its own, not by extension of whatever mesh its applied to. Or maybe to find a way to change that slider in blueprints (shown below) as I got it to work more smoothly somehow.

Oh my apologies! Gave you a whole lecture on the wrong topic. Alright so what we need to do to work with post processing materials is a bit different. So your first step is to make a new material parameter collection. This is basically a global parameter you can set from anywhere in your material.

Put all the parameters you want in to manipulate in there. In my case it’s just speed for a panner.

Then go back into your material and change out your params in there for a “CollectionParameter” node then in it’s details target your collection and the param you want to pull from then plug it in.


then you can access and manipulate that collection in blueprints at runtime.

I did mine in the level BP:

and voila! You can manipulate groups of parameters together this way.

UnrealEditor_2022-09-02_20-11-40

If you want to learn more about these collections:

(sorry I didn’t make a proper effect, this project only had the base textures in)
Let me know if you have any questions!

1 Like