Search Unity

Material Reflection behind Object

Discussion in 'Global Illumination' started by unity_1j-FoYVhweZOzw, Aug 7, 2019.

  1. unity_1j-FoYVhweZOzw

    unity_1j-FoYVhweZOzw

    Joined:
    Dec 18, 2017
    Posts:
    2
    I am working on an interior scene which has a floor texture that is reflecting the sunlight from the window. This is working fine but the directional light also gets reflected in areas where there's actually no light shining on it (through walls for example)

    here it's working just fine:
    upload_2019-8-7_15-35-4.png

    here the described problem:

    upload_2019-8-7_15-35-35.png

    How do I fix that? I saw some videos where the creator added custom scripts to remove the reflections where they are unrealistic - any ideas?
     
  2. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    103
    I tried reproducing the artifact you are seeing. I got similar unwanted reflections, but not as much as in your screenshots, so I don't know if I actually reproduced your issue or not.

    However, here is a few things you can try (in combination maybe):
    • I can see you have a reflection probe. Create another one and place it in the dark area of the apartment (near the artifact, by the front door). The specular reflection is realized by sampling the nearest reflection probe. The greater the distance between the shaded pixel and the nearest reflection probe, the greater the approximation error. Ideally you'd have a reflection for each pixel but obviously that is too expensive, so we usually just place them in "difficult" places.
    • If you don't want to create another reflection probe (to save on resources maybe), then instead try to move your current reflection probe to the center of the room.
    • Make sure your floor material is not 100% smooth. At 100% smoothness material behave like a mirror, and when combined with textures (wood in your case) it can look weird. Try reducing it to 95% or 90%.
     
  3. unity_1j-FoYVhweZOzw

    unity_1j-FoYVhweZOzw

    Joined:
    Dec 18, 2017
    Posts:
    2
    Thanks for your answer, adding another reflection probe fixed this particular problem. Unfortunately, I still get reflections behind objects where normally would be shadows - in this case behind the sofa:
    upload_2019-8-8_11-50-41.png

    I tried adding an additional reflection probe at exactly this area but that didn't help.

    Thanks in advance
     
  4. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    103
    I am afraid there is no easy solution to that problem. The artifacts you are facing shows one of the fundamental limitations of reflection probes, so I cannot give you a silver bullet answer.

    Things to consider:
    • Play around with adding more reflection probes and move them around. Consider that interpolation between probes is not done per pixel, but per object (so the entire floor will use the same set of reflection probes unfortunately - i.e. the same in front of and behind of the couch).
    • Consider ditching the reflection probes and instead go with Screen Space Reflections. They will be able to somewhat address the issue you are seeing with the couch, but they may introduce others. I think SSR can be used in combination with reflection probes but I personally don't know how that works.
    • If you are using the new HDRP render pipeline, you may consider using planar reflection probes. In a sense this causes Unity to render the scene (off screen) from the point of view of the floor. This snapshot can then be used to do reflection in the final frame. A bit like reflection probes, but they are planar instead of spherical. HDRP is powerful but advanced and probably not a good fit for mobile games/apps.
    • Simply tune down the specular reflection (by reducing material smoothness) to the point where the artifact is less noticeable. Of course this is not what you want, but it is a compromise to consider at least.