Search Unity

Question What's the plan for URP reflections improvements?

Discussion in 'Graphics Dev Blitz Day 2023 - Q&A' started by wwWwwwW1, May 24, 2023.

  1. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    767
    Hi, I remember that there're plans to improve reflections in URP.

    And in 2022.2, the reflection probe atlas was supported in Forward+ to improve probe blending.

    So what's the next step? Or is it not a priority yet?
     
    goncalo-vasconcelos likes this.
  2. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,269
    No Planar reflection?
     
  3. Matjio

    Matjio

    Unity Technologies

    Joined:
    Dec 1, 2014
    Posts:
    108
    Hi!

    Our first goal is to make URP the new default render pipeline to replace Built-in in most new projects and we should be almost there!

    We have plans after that to improve visual fidelity on mobile and above with URP. One area is improving reflections, but there are multiple directions, and we have not yet decided what we will prioritize first: SSR, planar reflections, dynamic relighting, unify with HDRP reflections. For each one there are different costs, values, usage, solutions and alternatives.

    There are various solutions on the web or the store for SSR (JoshuaLim, ShinySSR2) and planar reflections (boat attack demo, Pidi), some more appropriate for desktop than for mobile or more appropriate for certain content like product configurators rather than open environments (in general screen space effects are quite expensive in practice for games on mobile or XR which is why we have not provided something so far on URP). On the other side, aligning reflection probes between URP and HDRP would be great, but might also make the cost higher than 2 dedicated solutions if we offer too many options. We would need to find the right scalability settings.

    What are your use cases and platforms where you think we should provide a solution for by default, and how critical is this for you?
     
  4. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,269
    not OP but planar reflections seems like a must in any pipeline. For a water plane or for mirrors. Sure there is a cost and scalability needs covering but I do not think you can do without built-in support.
    Not just games but for arch-viz (which HDRP may seem better for but that has a high entry point).
     
  5. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    767
    Thanks for the detailed reply!

    Yes, I use URP because of mobile platforms support. I recommend prioritizing improvements to URP's reflection probes (rotation, sphere projection, runtime convolution?) first, because I believe this can only be integrated well by the URP team.

    There're some planar or screen space reflection solutions for URP on the Internet and I think there'll be more.
     
  6. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    767
    Planar reflection probes seem to be expensive on mobile but it'd be nice to have, because it's the only (non ray-traced) solution that supports mirror-like reflections.

    I saw that many mobile games implemented screen space planar reflection (a less accurate SSR without ray marching). I wonder if it's possible to implement this as screen space planar reflection probes (re-project color from previous frame) in URP as a faster solution compared to HDRP planar probes.
     
    andyz likes this.
  7. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    For me SSR is a must cause it's much more easily universal, then dynamic relighting for more dynamic scenes (ToD?), then planar reflections since that is the most circumstantial.

    It's not like solutions for planar reflections don't exist, it's just they're a pain to use in my experience. SSR is annoying sometimes but at least it just works.
     
  8. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    767
    Agree that reflection probe relighting would be a useful feature for URP. This can be a cheaper way to have dynamic lighting when combining with dynamic APV.

    But I'm not sure how this will be done in HDRP and if it's possible (or suitable) to support this feature in URP Forward and Deferred (no reflection probe atlas).

    I think the problem is that the development of new features in URP is a little slow.
     
  9. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    screen splace planar reflection using dx11 faster x5-10 times than any other SSR method and have pixel-perfect reflection.
    https://github.com/ColinLeung-NiloCat/UnityURP-MobileScreenSpacePlanarReflection
    https://remi-genin.github.io/posts/screen-space-planar-reflections-in-ghost-recon-wildlands/

    Here is comparison of my SSRP realization (with holes reprojection) vs HDRP reflection with high quality (48 rays)

    ezgif-2-c5ba081e4b.gif
     
    wwWwwwW1 likes this.
  10. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    767
    Yes, It'd be very useful to many URP projects. But considering the use of atomic operations (as shown in the link), I think the URP team need to find another way to implement SSPR (when it's planned).
     
  11. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    InterlockedMin with textures doesn't supported on metal (and partial support on android), but InterlockedMin with StructuredBuffer works perfectly.
    As vulcan supported on 85%+, so it must work everywhere. (https://developer.android.com/about/dashboards)
    I can share my code if it helps for unity devs.
     
    wwWwwwW1 likes this.
  12. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    How does this work when you look down? It seems to have similar occlusion issues to SSR, but it doesn't cause a huge stretching effect. Isn't the point of planar reflections is to see offscreen or occluded information?
     
  13. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    482
    SSR can work on planar surfaces too and will look the same as SSPR(if I understand correctly) so what's the difference? Performance?
     
  14. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    It's screen space reflection, which works only for planar surfaces (like a water). It's not a planar reflection (which requires the second camera and double rendering)
     
  15. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    More performant and fewer artifacts.
     
  16. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    767
    I think the control of SSPR can be terrible if the solution simply applies to a shader and attaches a script to an object.

    It would be more useful to implement SSPR as a mode of the planar probes (screen space, additional camera) in URP. This also makes rough reflections possible with SSPR.
     
  17. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    767
    I'm not sure if it's a common issue of SSPR, but it seems that in scenes with complex occlusions of (foreground & background) objects, SSPR produces more artifacts than (well-designed) SSR.

    (sorry that I cannot find a screenshot to show this)

    Regardless, it should still be a performant solution worth considering for mobiles.
     
  18. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    It's not possible, because SSRP reflect all depth pixels in "reflection buffer", while any other SSR trying to find this "depth pixel" using raycasting with 100500 misses and artifacts.