Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Discussion Real mirror achieved by camera manipulation?

Discussion in 'General Discussion' started by E1V26, Aug 27, 2022.

  1. E1V26

    E1V26

    Joined:
    Jun 21, 2021
    Posts:
    2
    I was wondering have anyone tried using mirrored camera to make a real mirror.
    I've seen a few uses static camera and render texture to "try" to make a mirror but those aren't real mirrors.
    Also, is it worth it to do it this way? or reflection probe is just better?
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,087
    They're as real as any mirror in a game that doesn't use expensive raytracing.

    Reflection probes generally make the most sense if you're dealing with multiple reflective surfaces and still use fundamentally similar processes to the render texture idea.
     
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    12,375
    https://forum.unity.com/threads/planar-reflection-mirror-legacy-renderer-vr-compatible.1170721/
    https://forum.unity.com/threads/vr-mirror-test-project.1219659/


    -----
    Proper mirror requires you to render your scene twice.
    And if you're doing it in VR, then you'll be rendering it three times.

    If you're not in VR but in flatscreen game, you can achieve mirror effect using camera stacking and matrix overrides.
    If you're in VR, you can no longer do that, because some of the required functionality is broken.
     
  4. E1V26

    E1V26

    Joined:
    Jun 21, 2021
    Posts:
    2
    What I meant was those mirror won't look right on other angles except direct front.
    And I think by manipulating the mirrored camera you can make a REAL working mirror.


    Let me put it this way:
    a single mirrored camera onto a render texture on a quad VS a same size reflection probe surface
    which will run better?
     
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    12,375
    If you're talking about cubemap reflection probe, t hen it will perform and look worse than a mirrored quad on a flat surface.

    If you're talking about HDRP planar reflection probe, it should largely be the same, but in VR it might not be aligned perfectly if you try to poke finger into the mirror (which is why I bothered with the project above).

    Unless you're running a raytraced environment, mirrors are expensive, regardless of what you do.