So first off, do you want a mirror or glass with a reflection? because even though they may seem very similar, they’re very different in how they’re setup. A mirror material is somewhat easy, but it requires a few things to setup.
First you need to make your material, which should look like this:
To explain how this works, is somewhat simple, there’s 3 parts to this material:
Base Color : this needs to be white if you want it to act like a silvered mirror, rather than a very reflective differently colored object. If you want to see what I mean, just change this color.
Metallic: this is a value that can be between 0 and 1, which determines how much like a metal this material looks like. We want to set this to 1 so that it looks completely like a metal. The reason for this is because a mirror in real life is actually a pane of glass with silver layered over one side of it, so the reflective qualities of silver (the metal) are what make a mirror look the way it does.
Roughness: this value can be all over the place, but we usually want to keep it between 0 and 1. To try and explain roughness completely could take a lot of time, but what it really means is just how “rough” the surface of the material is. Something that is very rough has a lot of different tiny planes on it in real life, which cause light to be reflected in all sorts of different directions which causes the light to ‘diffuse’ which is why we call materials like this a ‘diffuse’ material; they aren’t very reflective and can appear flat. Metals are the opposite of this, as they have very organized surfaces (so they have very low roughness) that direct light in mostly the same direction which is a 45 degree angle from where it hits the surface (called the angle of incidence sometimes). So to make something that is like a well polished and reflective metal, we want a roughness near 0. No real life object would have a roughness of 0 but very small ones like 0.001, but we can just set it to 0 here. So by setting roughness to a 0 constant, we get a very reflective surface.
Now if you try and put this material on an object and toss it in your world, it won’t do reflections properly. This is because in video games it would be very costly to try and do reflections by ray-tracing. So instead we use what are called “Reflection Capture” elements. A “Reflection Capture” element is something that captures an image of the screen so that you can use it in your reflections, and allows the game to run much smoother while still using reflections in real time. Unreal Engine 4 has a very simple Reflection Capture system though!
All you have to do, is place a “Reflection Capture”(Not “Scene Capture”!) actor in your world - which if you try to search in the assets you’ll find two that come up (picture below)
Now you’ll notice there are two: one is a cube and one is a sphere. A sphere will capture reflections as if it was a spherical object, and a cube will do it like a flat-faced cube. Each one has different pros and cons that I won’t get into, but just use a Reflection Capture Cube right now. All you have to do to use them is place one in your world where you want the reflection to be being captured from, so in your case it should be inside of your mirror or just at the front of it. Beware though, you don’t want a lot of reflection capture actors because that will make your game grind to a halt in terms of how slow it will be!
Now once you have placed a Rection capture actor in your world, your mirror material should be reflecting properly and you’re all set!
Now, if you wanted a glass material with reflective capabilities, then the shader will need to be different. Make sure you still have a Reflection Capture actor in your map (you will still need it for the glass to have a reflection). Then you need to create a new material. Make sure the material domain is set to Surface, and the Blend mode to Translucent. You may notice this grays out some of the plugs we used before, such as Metallic, but opens up other ones you need for glass such as “Opacity”. Well to fix that we need to change the translucency Lighting Mode which can be found under “Translucency” in the shader menu when the output material is selected. This needs to be set to a type that accounts for the surface of the material instead of the volume of the material, so try setting it to “Surface Translucency Volume”. Here’s a picture:
Now all the nodes you need will ungrey. Just recreate the material I’ve shown above. It has two constants:
Opacity: This is how transparent the material is, and this needs to be low but still a value above 0. It can’t be 0 otherwise you won’t see any reflections, but the closer to 1 it becomes the more opaque your material will get.
Roughness: Just like before, we need a roughness of 0. Glass isn’t a metal though and metals aren’t (normally) transparent, so you don’t want to plug anything into the metallic node.
Now once you apply this material, go try and look at it in the world. There should be the faint reflection of the world around it in this mostly-transparent glass!
I hope that helps clear things up for you!