How to change material of whole level through trigger

Hello all!

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:

After the interaction, all actors should show their “real” material.

How would I do that? I am a total beginner so I don’t know where to start.

I’ve watched some tutorials but nothing really fits my problem. The one which gets closest is this: https://www.youtube.com/watch?v=sC2_g3p6rx0

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:

Any help would be much appreciated!

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.

Example of transition material:

Thank you for your answer.

Does this approach mean I’d have to create two texture sets for each mesh?

And how would the change/transition be triggered if it’s just one material?

I’ve tried it with post processing, but unfortunately the results weren’t really what I wanted.

Sorry, I’m rather new to working in the Engine!

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.

Hi Nawrot,

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.

I am quite sure that in game you took as effect idea it was made by post process material. So make sure first you checked that.

I’m sorry, I’m not quite sure what you mean by that. Do you mean I should check in the future how it’s made in my references?

Pot process material:

You need something similiar:

  • 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!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.