Hi;
I need to create a simple; proper mirror with sharp reflections. (I have a large outdoor scene with a miror-like sea). For outdoors sharp reflection like these the Reflection Environement and/or SSR don’t cut it quality wise.
In UDK this worked quite simply using the Scene Capture Reflect Actor, and feeding it into a texture with Screen Aligned UVs. This no longer exists in UE4. There is a Scene Capture 2D actor, but it doesn’t work the same way. For one it doesn’t update its capture view point acording to the player’s position. (ence why’s it’s called a 2D capture; and not a proper Reflect actor like in UDK)…
Is there any way to do this? I can’t believe there isn’t a way to do a simple mirror.
Thanks in advance for any help; as it stands my project is stuck in UDK just because of this…
You can get an approximate effect using a Scene Capture 2D tied to your player’s Camera through a Vector Transformation. It is an approximation, but it will get you close.
Thanks I’ll give it a try!
Those screenshots look like the Content Examples scenes; but I just looked at all the Blueprints one and I can’t find it. Did I miss it or is that a scene of your own?
Few questions, as Im interested in this method. How does it know to orient around the object being used as the mirror? and also, what blueprint is this in and how did you get the scene actor 2d inside a blueprint aside from the Level Blueprint? Did you create it via blueprint inside the character’s blueprint and then reference it?
+1 to Grayve’s questions. Which blueprint does this go into, and how do you add the scene capture 2D node so that it works with the set world rotation node?
Ah not quite as realistic as I hoped the result would be, but it could be an interesting effect for somethings. I was hoping it would give relatively accurate reflections like screen space reflections do. There might be a different way to use that same concept to get more realistic results though
In my sample from above, You would need to setup a new GameMode and New Player Character and New Pawn Class from the default versions in the engine. Assign them to the level via the World Settings and in the Default Pawn Class, check Owner Only See which will not allow the Render target to see the pawn but you will still be able to see it (assuming you are not just using the sphere in which case you could just Check Hidden in Game true as well.)
Plug a Texture Coordinate into the Render Target Texture in the Mirror’s Material and set the coordinate UTiling Value to -1 and the VTiling Value to 1. This will flip the image horizontally.
I ran into the same issue, the camera is just pointing back at the player so you don’t get bounced image like you actually would. I’ve update Eric’s BP to calculate the reflection vector (see Reflection Vector? - Rendering - Unreal Engine Forums). Along with implementing Eric’s image flip instructions above this delivers a fairly realistic mirror.
this is how I set the event graph of the blueprint
and then I flipped the captured scene on the material of my mirror
however setting it like this gives another issue: when you try to look at it by side you start to see the mirror itself reflected or, worse, behind the wall where is the mirror (it dipends on how you set the “Field of View” of the “Scene Capture Component” in the blueprint)
could it be possible to set a limit on the “Z (Yaw)” rotation result so that when you go too sided to the mirror it stop and you don’t see this error?
I tried both moving the “Scene Capture Component” respect to the mirror, and working with math operator in the blueprint (but for sure I’m not a blueprint genius so…)
Yes add a Clamp for min and Max Allowed rotation on your Yaw. That should force the Max value to always be returned when the actual Yaw value goes over it (same for a min on the opposite side of the mirror.)