Search Unity

Resolved How do I make a "wide angle" mirror? (using planar reflection probes)

Discussion in 'High Definition Render Pipeline' started by cLick1338, Mar 21, 2023.

  1. cLick1338

    cLick1338

    Joined:
    Feb 23, 2017
    Posts:
    74
    How do I emulate a "wide angle" mirror using planar reflections? Here's a real life example of what I mean. (Right side, ignore blue tint and slight curve of the reflection.)

    Example.PNG

    The probes have "Field Of View Mode" settings but they don't change what I need; I see the FOV changing in the inspector preview but the FOV on the mirror object stays the same. (It has other consequences like changing the "useful" resolution and makes the reflection fade at the edge of the screen).

    If the inspector preview is accurate, probes seem to render much "wider" than is needed, which seems very wasteful. There are 3 FOV modes but all seem equally useless. I'm pretty sure I'm missing something here, maybe someone can help out.

    Using 2022.2.11, HDRP 14.0.6
     
    Last edited: Mar 21, 2023
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I don't know how to do with reflection probes (out of ignorance), but have created mirrors like this with a camera projecting onto a texture which is the mirror. You can put any settings you like then on the camera (change FoV etc). It took a performance hit (two cameras being rendered), but you had a lot of control and it was perfectly accurate.
     
  3. cLick1338

    cLick1338

    Joined:
    Feb 23, 2017
    Posts:
    74
    Yes, that is an option but I'm keeping it as a last resort. I had tried secondary cameras before but the performance hit was too big. This was a while ago, maybe it's better now but still I'd rather not reinvent the wheel.
    Planar reflection probes have acceptable performance, I just need proper FOV controls.
    I've tried using the reflection probe node (ShaderGraph) but it doesn't seem to do anything for planar probes.
     
  4. cLick1338

    cLick1338

    Joined:
    Feb 23, 2017
    Posts:
    74
    A.PNG B.PNG
    Turns out using an actual convex mirror is a solution. I'll have to figure out an easy way to adjust the convexity (probably just modify the normal map on a quad through shadergraph, eventually baked in).
    Still open to other ideas but this is probably the answer. I like that it can also maintain the distortion effect of the real thing, it's better than what I initially thought I'd get.
     
    Last edited: Mar 21, 2023