Home Unreal Engine

UE4-Plane reflection- mirror reflecting another mirror??

polycounter lvl 10
Offline / Send Message
melviso polycounter lvl 10
Can a plane reflection actor be used create two mirrors at 90 degrees to each other? From the image below:
The mirrors are not reflecting each other. Any workaround to this?
 

Replies

  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    You would have to draw the scene "infinite" times for that to work correctly. Can't you avoid it?
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Is there any drawback to doing what you mentioned? Why is this avoided in game engines? This is for an archviz project.
  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    Because rendering a pixel infinite times is impossible to do. You wouldn't do that of course, you would cap it at like 20 renders or something but that's still very expensive to do so it's not possible to do it that way in real time

    I doubt Unreal had a toggle somewhere that allows bounce reflections like this. You would have to write a custom shader/material that approximates the effect.

    You could try placing two cameras behind the mirrors, then rendering their output to textures. That's going to get expensive.

    Or; you can utilize some parallax offset with a reflection capture or do some shuffling of colours as you get towards the center of the mirror

    This is something that may require a fair bit of research. Screen Space Reflections won't get you there, reflection probes aren't going to handle the bounce reflections. There are some solutions in real time but they all involve some trade offs, thankfully because you're not rendering a character it gets a bit easier to take it. Take a look around at real time reflections and you'll get the idea.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    melviso said:
    Is there any drawback to doing what you mentioned? Why is this avoided in game engines? This is for an archviz project.
    Basically because in offline rendering, you have time to wait hours to render the scene hundred times, and in a game you really don't...

    There is a workaround for this though, you could use blueprints and move a scene capture around and draw into a render target again and again. You could manually control the amount of steps. But if you are not familiar with blueprints, this isn't really an option.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks for the reply, guys. I think I will have to take down one of the mirrors. 
  • Robbie222
    Options
    Offline / Send Message
    Robbie222 polycounter lvl 3
    I think it should work with scenecapture2d or scenecapturecube. You move them a bunch of times to capture more reflections.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Ok. I will give the screencapture a go. Between the 2d and cube. Which is better? I gather that the screencapture 2d is cheaper. I tried the screencapture cube but the scale of the reflection remains the same. I believe this is where blueprint plays a role.
    I can't find any video tutorial of how to set this up using blueprints. Any where I can look this up step by step. I am kinda a blueprint noob tbh. On a side note, I better start learning blueprints since I hear it makes things easier.

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    I would say you should not experiment wiht this, its kind of complicated. You need to figure out what the viewer would see from the players perfpecvive,  represented from the scene captures view. So basically you need to align the scene capture with what you would see in the mirrors in mirros and you need to iterate them. This isn't anything 2 minutes or simple rule, you got to understand whats happening. But it definitely works. It is expensive though but if you go for 3-4-5 bounces its doable if you really need it.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    This is a kind of a thing that you may hire some people to resolve unless you can do it yourself
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Ok. Noted. Thanks for the heads up.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Btw, does anyone know how to go about creating this:
    https://www.youtube.com/watch?v=O2JBB6RCCM4
    Can this be done using a material where the timer moves accordingly or blueprints. I tried looking this up on youtube but all I see are timers for game screen or countdown tutorials. How about for timer display on static mesh? or is this done with decals?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    You can use "debug scalar value" can do this, or you could have 2 panning textures:



    In this example, the value would loop between 0-24 and update every second. With a different math, you could get this correctly displaying hours and minutes as well using a single debug float node.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks a ton, mate. Any chance you can share the maths for hours and minutes. That's the one I need. Is this plugged to the emission slot?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Later today I'll come back and show you. I'll probably put it into a complete tutorial to include explanation of positioning, and other stuff. Its probably useful for other people as well.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Ok. Thanks mate :- )
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Here you go. I decided not to go much into the details, its pretty straight forward. Seconds - minutes:


    To change the decimal point to a colon, go into the debug scalar function, youll see there are 2 textures. One for the numbers font, and one for the point. Its packed into one of the channels. You can change that texture. You can also change the font texture.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks a lot mate, :- )
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    NP. Show us the results if you are allowed.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Sure. I will post it on here. Thanks again :- )
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks a lot Obscura. :- )


    Any chance I can add the Hour part to the clock display? 
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Sure you can.  Just use different period with the time, and different division. But for this, you will need a second debug scalar node. because a number can't really have 2 decimal point. And then just add the 2 debug scalar node together. You will also need to position it using the uvs input of the second debug scalar.

    Or you could do it with a single debug scalar, but then you wouldn't be able to have seconds displaying.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks. 

    EDIT: Just found out about ue4 flipbook. Seems to over a better solution since I need a specific time to display on the clock and counting. Thanks for the help though. :- )

  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Is there a way to have a fixed time using DebugScalarVaules? Say like 13:00? I want to try out a technique.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    "Time" is just a float value that increases on every frame. So you can just have a scalar parameter or constant to imitate "static time".
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    EDIT: No worries
Sign In or Register to comment.