It is possible to create a Mirror Maze using Scene Capture 2d?

Hi everyone,
Today I’m going to ask you a very challenging question:

It is possible to create a Mirror Maze inside UE4?

The scheme of what I would like to obtain inside the editor is this:

I’ve tried to create a Mirror Material using a Scene Capture 2D but it’s not even thinkable to use a Scene Capture for each mirror because It would destroy badly the performances.

Two ways I was thinking to realize this are:

1)Using blueprints to activate or deactivate the scene capture in order to use the least possible number of render cameras.

  1. Using a single scene capture inside the character blueprint, that renders the emissive texture to use as material in the mirrors.

The 1) Idea would be good but even 2, or 3 render target active in the same area is a big deal.
The 2) Idea would be good but what I obtain using this technique is not more a Mirror effect.

So the questions are:

There’s another way to obtain a Mirror reflection without using a Scene Capture?
There’s a tricky way to use multiple scene capture in the same area without making explode your hardware?

Hey Maximvm -

As you say this is a complicated issue, but you could start by using a Blueprint to blend between a material using your render camera and one in which you are using a reflection vector on a highly metallic, no roughness material. You can then interpolate between them based on the player’s distance. This way your mirrors would never lose reflectivity but you would be taking the less costly route for objects farther away and the more detail, accurate route close up (So, your are developing an LOD system for your reflections).

There are still some more issues, but this should get you started.

Thank You -

Eric Ketchum

That’s very interesting, I’ll give a try and put here my work as soon I have an update of it!

Thank You very much Eric

Here is some Material Information to get you started, to do this we setup two Material Functions, one that is your base no scene capture reflection and one that is just your scene capture.

Here is the Base No Scene Capture Reflection (the texture Sample is just a field of solid white, but this would be where you could texture your mirrors if they are dirty or tarnished):

Here is the Scene Capture Material Function (whatever dirt or tarnish would also have to be added to the Render Target):

Here is the final Material which is Blended by a Parameter which we will control in a Blueprint:

Here is the Event Graph for a Mirror Actor, whose components are made up of a Static Mesh and a SceneCapture 2D. This will get the distance from the Player Character to the actual mirrored object and compare it to a set distance value and switch the material blend as needed.

Here is the Blueprint’s Construction Graph where you are assigning a dynamic Material based on that final Material.

This is still going to have multiple scene capture components for each mirror, but at least you can control exactly when the CPU is actually rendering those elements which should help as long as you can dial in that distance comparison.

This is by no means the only way to do this, but hopefully it will spark some ideas for you.

Let us know how it turns out

Eric Ketchum

Hi Eric,

Thanks a lot for your reply, It gave me a very huge base to try to build what I need.

Here’s a vid about how is going on the prototype of this Mirror Blueprint:

I did some changes:

First of all I added a box shape in the mirror blueprint, that can casts overlap events, cause if I put on a scene 100 windows frames, I do not want to calculate every tick the distance between the player pawn and the mirror blueprint:

So , inside the Mirror Maze blueprint there’s a scene capture 2d placed at the most center of the window frame, then I added a looking at behaviour between the scene capture and the pawn, to obtain a more realistic mirror reflection

Then I didn’t wanted to turn off and on the mirror maze like a switch so I added a sort of blend in effect that becomes stronger as the distance between the mirror and the pawn decreases.

So if all the conditions are set right the Scene Capture will become active like this:

But if any of these conditions is not respected:

Of course now I have something that can be improved still a lot, but it’s nice a prototype thank to the ideas of Eric.

What I want to achieve right now is to do a better base material for the mirror effect without the scene capture.

I do not know why but I think there’s a problem setting the proper lighting enviroment to obtain the correct base material for the mirror.
I