Search Unity

Question why URP bans depth copy for all GLES

Discussion in 'Universal Render Pipeline' started by cyberjoys, Aug 9, 2022.

  1. cyberjoys

    cyberjoys

    Joined:
    Dec 1, 2020
    Posts:
    66
    upload_2022-8-9_18-11-40.png
    hi, i m using 2021 with URP now, and find that Copy Depth Option will result Depth PrePass when on android device, upon investigate a bit into UniversalRenderer, i see unity has block depth texture copy if GLES is in used,
    coz i used to make seperate depth buffer and copy from that if shader needed it, and it runs fine on all the android devices that were available to me at the time.

    so, i would like to know why unity would come to the decision like this ? preventing depth copy for all GLES ?
    becoz of performance reason? is it because you guys have to consider MSAA depth copy, no MSAA depth copy is still viable? and invalid result ?
     
  2. kierenj

    kierenj

    Joined:
    Jul 7, 2013
    Posts:
    13
    Doesn't the comment explain it very clearly? It even points to a place to find more information?
     
  3. cyberjoys

    cyberjoys

    Joined:
    Dec 1, 2020
    Posts:
    66
    wel, were you able to find out more from that point of place on fogbugz? plz do share what you found.
    if i was able to inverstigate further from there, and clear my question, i wouldnt have make this post, wood i ?
     
  4. kierenj

    kierenj

    Joined:
    Jul 7, 2013
    Posts:
    13
    The comment says, "Copying depth on GLES3 is giving invalid results" - so there's a bug in GLES3.

    "This won't be fixed by the driver team" - the team who develop GLES3 (not Unity) won't fix it -

    "...because it would introduce performance issues" - their reason given is that it would impact perfomance.

    So that's why Unity doesn't allow that feature: it doesn't work, because of the decision made by the GLES3 team.

    I'm not sure what else there is to "find out". It's not something Unity needs to fix, or can fix.
     
    DevDunk likes this.
  5. cyberjoys

    cyberjoys

    Joined:
    Dec 1, 2020
    Posts:
    66

    well thx so much for point out the obvious,
    1. i used custom depth and copy with Unity2018 for process like motion blur and TAA for high end device, the game is built only with GLES 3 for android, and the game is on the market. and i have tested on all the physical devices that i had at the time, they all work fine, plus, up til now, i havnt received any complaint about having abnormal graphic issue from our game that has been out on the market for about 1.5 years.
    2020_02.png


    2.we also have another WIP game with 2020, which by default (by URP) was doing depth copy on all platform (including GLES 3.0, window at least)
    2020_01.png
    and 2020 does not have depth priming at all, looks like depth copy was their default choice for URP unity


    now put your feet in my shoes, do you still think that simply "driver issue, wont fix" would be the answer enough for me?


    if depth copy on ES 3 is really an issue, i have no choice but to make the change now for the game with 2020, and for the game with 2018. if that really is some problem major.
    but from my personal test and our games' market feedback, i dont see any problem or complaints now.

    so once again, i would like to know why unity would come to the decision like this ? preventing depth copy for all GLES ?
    becoz of performance reason?
    is it because Unity have to consider MSAA depth copy, no MSAA depth copy is still viable?
     

    Attached Files:

  6. ManueleB

    ManueleB

    Unity Technologies

    Joined:
    Jul 6, 2020
    Posts:
    110
    the MSAA copy was disabled because it just doesn't work in the Unity GLES backend, as mentioned in the comment. Fixing the backend to have bindMS working on GLES would hit performance pretty badly so we decided to not allow the MSAA copy since the prepass would still be a faster option anyway.

    Regarding non-MSAA copy, that works in our backend and we have been too aggressive on the URP side by not allowing the copy in that scenario as well, we pushed a fix for that which will be in the new release:


    Code (CSharp):
    1.  if (IsGLESDevice() && msaaDepthResolve)
    2.                 return false;
    So depth copy should work on GLES in the future if MSAA is off
     
    cyberjoys, DevDunk and JesOb like this.
  7. cyberjoys

    cyberjoys

    Joined:
    Dec 1, 2020
    Posts:
    66
    hi ManueleB, is it possible to make an update push for 2021 URP package ? i m using 2021.3.6f.
    modifying package cache locally in the library folder seems to be not allowed (upon editor re-compile, the change will be gone).
    or is there anyway that local modification can be done ?

    cheers
     
    Last edited: Aug 29, 2022
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    If you make a modification to a package you have to put it inside the packagea folder. Then it will override
     
  9. cyberjoys

    cyberjoys

    Joined:
    Dec 1, 2020
    Posts:
    66
    got it, cheers
     
    DevDunk likes this.