x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Creating a mirror using Scene Capture 2D actor?

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..

Product Version: Not Selected
Tags:
more ▼

asked Oct 20 '14 at 03:02 PM in Rendering

avatar image

Aloys
6 1 2 3

avatar image ferpenas Jul 13 '15 at 08:44 AM

Hi Everyone, I tried all the examples about mirrors but no one "flip" the image like the real mirror do. alt text

Someone know how to do it?

proof.png (611.5 kB)
avatar image Lovecraft_K ♦♦ STAFF Jul 13 '15 at 01:58 PM

Hi ferpenas -

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.

Thank You

Eric Ketchum

avatar image ferpenas Jul 14 '15 at 05:37 AM

Thank you Eric, now it works perfect.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Aloys -

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.

Blueprint

Example

Thank You

Eric Ketchum

mirror.jpg (99.0 kB)
mirrorexample.jpg (29.6 kB)
more ▼

answered Oct 20 '14 at 05:08 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.7k 702 260 735

avatar image Aloys Oct 20 '14 at 05:59 PM

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?

avatar image Lovecraft_K ♦♦ STAFF Nov 10 '14 at 06:51 PM

This was my own test bed. I use it to tet various issues we come across on the AnswerHub.

avatar image Grayve Rose Nov 27 '14 at 05:49 AM

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?

avatar image AntSkilton Feb 10 '15 at 10:34 AM
  • 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?

avatar image Marou1 Feb 10 '15 at 07:12 PM
  • AntSkilton and Grayve's question. Could anyone provide some help please?

avatar image LethalMongoose Aug 29 '15 at 06:14 AM

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 https://answers.unrealengine.com/questions/129907/reflection-vector-1.html). Along with implementing Eric’s image flip instructions above this delivers a fairly realistic mirror.

avatar image Lovecraft_K ♦♦ STAFF Feb 10 '15 at 09:45 PM

Hey Guys -

Sorry for not seeing your responses until now. I have setup a small test project with this particular effect running so you can see how I did it.

Sample_Project

Thank You

Eric Ketchum

avatar image Yahiya Jasem Apr 04 '15 at 04:34 AM

many thanks! you're a life saver :D

avatar image Grayve Rose Apr 05 '15 at 03:14 AM

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

avatar image Hainzgrimmer Mar 22 '16 at 03:49 PM

Thanks to have provided your file Eric, I've downloaded and modified a bit to have a more realistic reflection: alt text this is how I set the event graph of the blueprint

alt text 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) alt text

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...)

could this be helpful in someway?

avatar image Lovecraft_K ♦♦ STAFF Mar 23 '16 at 03:43 PM

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.)

Eric Ketchum

avatar image Hainzgrimmer Mar 24 '16 at 08:57 AM

It worked! Thank you very much Eric! alt text I post the eventgraph modified to complete the example even for the others (the values of the clamp will obviously depend on the single projects)

However I hope epic will find a proper solution for mirror both on destop and mobile projects! :)

avatar image Tolero Mar 10 '15 at 05:20 PM

Thanks a lot! Looking for this for so long...GREAT!

avatar image kirnold Jun 25 '15 at 09:25 AM

How can I remove player sphere in reflection?

avatar image Lovecraft_K ♦♦ STAFF Jun 25 '15 at 05:13 PM

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.)

Thank You

Eric Ketchum

avatar image Tuxmask75 Apr 13 '16 at 04:47 PM

Hey guys, I'm trying to adapt this to work for a mirror facing up that a character can walk on as the floor, so far I'm having no luck.

avatar image Lovecraft_K ♦♦ STAFF Jun 07 '16 at 03:35 PM

Hi Tuxmask75 -

Try using the new planar reflections in 4.12.

Eric Ketchum

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question