In my level, I want to change the material of the whole scene into another after an interaction. As in, the player character gets a memory chip from a chest, then is able to interact with a specific machine which should be the trigger for the material change. Before the interaction, the level should be just white, like the “Copied City” in Nier:Automata:
I’ve tried it with a placeholder material but it’s the wrong way around and it doesn’t affect decals. It also doesn’t work with my grass as it can’t use the opacity map:
For multiple meshes in level you doing it wrong (not optimal way).
Instead create single MASTER material. Makes some float parameter like “Transition”. Then expose textures for both states of transition. And linear interpolate between them.
Then create instanced material for each mesh, and apply correct textures. And then either go trough all of materials and change parameter “Transition”.
Or use parameter collection (in master material) expose (use) that “Transition” from collection instead of from parameter in material. Then is matter of changing that Transition in collection.
So TLDR:
make master material with Transition, and textures as parameters.
make instanced materials, set up textures, apply instanced materials to meshes
either animate transition for each mesh, or use parameter collection and change it there
You can also use post process material and volume, and change saturation/colors etc. Not sure if you really need to change materials or just colors of whole scene.
No i posted master material, after recreating it, you need:
create instanced material out of that master
in instanced material assign TEXTURES from before and after transition, then apply that instance to mesh.
there is float parameter called transition
use that transition parameter to blend materials (from 0 to 1)
last problem is to decide how you manage it all. Least controll but also minimal hassle is to manage it trough parameter collection. Just create collection, drive that parameter from some blueprint
ps.
Unreal is picky about creating DYNAMIC instanced material, sometimes instanced materials work (when changed by animation) but sometimes unreal demands dynamic instanced material, which will require blueprint actor and creating it there, so every mesh will be blueprint actor.
I am simply not sure if collection parameters will change simple instanced material (during runtime), or it requires dynamic instanced material
Alright, I will try to work this out, thank you very much for your detailed answers. I’m still a bit confused about how to call the transition parameter from my material switch blueprint.
Thanks for the warning, I just hope I won’t have to create a blueprint actor for every mesh.
I had much to do, but with a little help I finally managed to do what you proposed. It didn‘t work without the parameter collection, but that‘s totally fine for me! I didn‘t even need to convert the meshes into blueprint actors, it worked just fine with static meshes. Thank you very much for your help.
make desaturation material for whole scene (simplest ever material)
find out how to separate your character (or selected meshes) from rest, it was quite simple, however i forgot that keyword (or what it used). Hint it was always in materials that did outlines
combine those two things, add parameter, apply to post process, and you are done
Alright, I’ll look into it in the future. In this case, your first idea was the best for me I think, as I needed to change not only the Base Color, but Roughness, Normal etc. too (but some meshes excluded, i. e. the tree). This worked well for me with the parameter collection. Anyway, thanks for your help!