Hi VFXperts,
I’m working on a project where we would like to have a lot of different material effects for statuses built into our master character shader. For example burning, poison, frozen, empowered, etc, appearing as panning textures or fresnels overlaid on top of our existing character textures.
Our intention is to set these up as Material functions and then only turn on the sections we need as we use them.
My question is about how to set this up whilst trying to be as optimised as possible. Obviously we could just make a giant master shader with all the effects at once and lerp in these when needed, but making a material that included all of these possibilities would get super expensive.
In previous projects I’ve worked on we’ve just duplicated the whole character mesh and applied a separate material to it, or swapped out the basic character material for a different one with the required nodes as different statuses happen, but both of these have drawbacks and I’m wondering what the best approach is for this in Unreal at present. It’d be awesome if there was some way to dynamically swap in material functions at run time, only turning on the ones we need.
We tried setting up our material instances with switch parameters that toggle on our effect nodes, but these can’t be triggered at run time, so we only see the effect if we toggle it on before launching the game, in which case it always adds its instruction count.
I was trying to see how Epic did their material effects on Paragon by looking through their free assets on the Unreal marketplace. An example is this frozen effect that the frost lady (Aurora) causes on other characters:
From what I can see by looking at their character material, they’re using a material function called MF_CharacterEffects.
When i looked into this function there are a few things that are always on (death fade and hit flash), but other than that it doesn’t seem to do much.
It does reference this Material Function called ML__Blank in a folder called Material Layers though.
Since this doesn’t do anything, I was wondering if in fact this is something they override at run time to generate all their effects? I can’t see any blueprints or anything that reference this sadly.
I dived into reading about Material Layers (not to be confused with Layered Materials), but that mostly seems to be used more for masking many materials on one character/prop/environment, and not for VFX.
Does anyone have any experience using Material Layers for dynamically turning on and off material effects for characters? What is the best approach when you potentially have a lot of different, costly effects you’d like to apply to your characters?
Thanks in advance.