Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

[Video]URP has sorting orders problem on Android, causes heavy overdraw for opaque obj

Discussion in 'Universal Render Pipeline' started by lauhonyeung, Mar 4, 2021.

  1. lauhonyeung

    lauhonyeung

    Joined:
    Apr 29, 2017
    Posts:
    30
    I've already disabled Dynamic Batching and Instancing, but it still try to draw far object first.
    This causes heavy overdraw for opaque obj, how should I fix this?(But on Editor, it seems working well from frame debugger)

     
  2. lauhonyeung

    lauhonyeung

    Joined:
    Apr 29, 2017
    Posts:
    30
    no one?
     
  3. lauhonyeung

    lauhonyeung

    Joined:
    Apr 29, 2017
    Posts:
    30
    last try
     
  4. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    Also experiencing this issue, specifically on Android. Editor seems to be fine. Additionally, I've noticed that using additive scenes is another source of overdraw (objects in different additive scenes draw over each other)
     
  5. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    350
    I noticed this years ago on a quest1 project. I guess the tiled renderer in some android devices forces a different kind of sorting. As a short and easy to implement solution you probably want to try to combine more objects (maybe just with static batching) and force some objects to draw later with queue offsets. While it isn't nice it works. That additive scenes behave differently as one big scene sounds scary though.
     
  6. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    After a long research, I've discovered:
    * Overdraw of opaque objects does NOT affect most devices in any way. (test devices: Pixel 4A, Galaxy S21 Ultra)
    * Overdraw is mostly caused by having "No distance sort" in Camera settings, which is hidden from developer in inspector, but available via scripting (https://docs.unity3d.com/ScriptReference/Rendering.OpaqueSortMode.html). Older devices seem to use "Default = No distance sort" (Pixel 4A), newer devices have "Default = Front to back" mode (S21 Ultra). You can override this behaviour with code, but, according to my tests, it makes absolutely no difference related to frame timings.
    * Additive scenes are not the cause of the issue. It's mainly due to broken occlusion culling (if used) with Addressables (and Asset Bundles in general). More info described here (two sequential posts): https://forum.unity.com/threads/occlusion-culling-not-working-in-one-area-help.890746/#post-7994973
    * Transparency and alpha-clipping may affect rendering, causing it to render "to camera" instead of "from camera". If possible, avoid all usage of alpha for better performance.
     
    unity_IpxdANggCs1roQ likes this.