Search Unity

RTX Reflections - Distance from object limit?

Discussion in 'High Definition Render Pipeline' started by dl290485, Oct 1, 2021.

  1. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    I have an issue with an all RTX project. Reflections are seemingly being culled based on how far away the object seen in a reflection is. So if an object is too far away, it won't be visible on another wall (even if the wall it's to appear on is close).

    Here is an example. This is looking into a mirror so everything seen is behind the camera. First you can see the wall on the left side of the mirror image and then it goes to darkness where the refection cuts off.I back up a little bit and the yellow handle appears (because moving back away from the mirror moved in range of the yellow handle).




    How do I extend this distance? It's much too short and is very jarring everywhere constantly when moving.

    Here is another example:
    upload_2021-10-2_3-30-9.png

    upload_2021-10-2_3-31-3.png
     
  2. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    You can try to increase "max ray length" in your screen space reflection override.

    Also, keep in mind that in this kind of scenario, when geometry reflected is behind, there is some funky things that can happen with shadows and animation (because they can be culled if outside camera frustrum).
    What you can do is add a Ray Tracing setting override and test if those settings helps

    upload_2021-10-4_10-26-47.png
     
  3. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    I already tried extending the ray length. It did not affect this at all even when set really high.
    And it's not just when things are behind the camera. The first example above is looking in a mirror, but the second one is just looking forward. So focusing on the second example you can see the orange part of the wall reflecting on the floor when it shows, but is culled when only a few steps away from the orange object. It's like there is a culling setting somewhere banning reflections from objects which are at a distance from the player, even when the object projected onto is close.
     
  4. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    I'm curious about it, If you have a small repro project, please send it so we can have a look (or log a bug report and drop the case number here).
     
  5. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    I haven't had the time to play around with it since posting. But yes, when I do have the time I'll start a new project and see if it happens with just plain block objects and basic textures. If it happens I'll share. If it doesn't seem to, I'll import the sci fi map asset again and see if that is somehow related. I guess I could also just grab the current project, make a new scene, and see if basic objects what happens.
     
    chap-unity likes this.
  6. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    [QUOTE="chap-unity, post: 7547938, member: 3921812"log a bug report [/QUOTE]
    Sorry it's not what you asked for (yet), but I just started tinkering with this again to investigate. Through this I have actually narrowed it down to the type of light which is being used to illuminate the object in the reflection.

    So just to clarify it all, the issue is objects not being visible in a reflection, when said object (NOT mirror) is too far from the camera. I now know that

    1) Emissions are always visible in reflection, no matter how far away
    2) An object illuminated by a Point Light can be seen further from the camera when compared to one lit by a Spot Light using a Cone shape. HOWEVER if the spot light uses a Pyramid or Box type shape, it IS visible as a distance where Cone is invisible.
    3) The distance is maybe just far enough that it's not completely jarring, but it's still a hard distance limited I would have hoped for some control over.

    In this image you have the Scene up the top and the Game window down the bottom. They are facing opposite directions. The top window is looking point blank into a full mirror, so you see the hall (behind) reflected). In the distance before it goes black you can see a yellow rail. As can be seen in the Game view, the hall is lit to the end with point lights.
    upload_2021-10-10_15-15-49.png

    This is exactly the same set up but with point lights disabled. Nothing else moved
    upload_2021-10-10_15-19-10.png

    The game view shows that the rail is lit by the spot light but is not visible

    This is the same again (view angle slightly rotated) but with the spot set to Pyramid mode:
    upload_2021-10-10_15-21-51.png

    This is on 2021.2.0b15.3666

    I'm going to start the blank project now.
     
  7. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    I made the small repro but accidentally wrecked it too trying to delete the starting sample scene, which seemed to take out some settings files. Anyway it's easy to do. Just enable RTX and SSR and there you go, it's limited in range.

    Now I have just found an override setting which directly affects the reflection distance: Light Cluster (Preview)
    upload_2021-10-10_20-36-0.png

    The default number is 10, and I set it to 30. Now using my mirror set up I can see all the way to the end of the room using the point lights, and can see the back wall lit up when using only a spot light. The spot light is still being odd though in how it's allowing things to show or not.

    Anyway this override is directly correlated to or is the thing which is limiting the range from the camera objects are allowed to give a reflection from.
     
  8. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Yes and it's expected to behave that way.

    For ray traced effects, HDRP needs information about lighting in world space to be able to take into account lights/probes that are behind the camera for example. By default, it uses a 10m cube centered around the camera.

    Also, in the HDRP asset, there's a maximum light per cell (8 by default) that you can increase if needed. If the limit is reached, some light won't be taken into account and you will see unexpected artefacts.
    There's even a debug mode for this (Window > Analysis > Rendering Debugger > Lighting > Full Screen Debug Mode > Light Cluster where you can see where the limit is reached.
     
    dl290485 likes this.