Search Unity

Bug Single Pass Instanced Broken on URP 10

Discussion in 'VR' started by ryanslikesocool, Apr 16, 2021.

  1. ryanslikesocool

    ryanslikesocool

    Joined:
    Jul 31, 2016
    Posts:
    49
    Single Pass Instanced rendering seems to be broken with URP 10. I've tried with a brand new project on Windows, Mac, and Oculus Quest 2, and it always results in the same thing. The left eye is gray and the right eye is black. Multipass works well enough, but I've found little to no support and information on it for screen effects. Any ideas when this will be fixed, or if I'm doing something wrong?
     

    Attached Files:

    saurabhdeshp likes this.
  2. ThomasZeng

    ThomasZeng

    Unity Technologies

    Joined:
    Jun 24, 2019
    Posts:
    85
    Hello there!

    I think single pass instanced is not supported on most of the Mac platforms because Mac does not support the required extensions. You could found more information in the supported platforms session here: https://docs.unity3d.com/Manual/SinglePassInstancing.html.

    Thank you!
    Thomas Zeng
     
    ryanslikesocool likes this.
  3. ryanslikesocool

    ryanslikesocool

    Joined:
    Jul 31, 2016
    Posts:
    49
    Thanks for the quick response! I had totally missed that page. Google kept bringing me to the page with the shader information, so I had no idea about platform requirements. I thought it wasn't working on Windows or Quest, but after closer inspection, that's a different issue.
     
  4. ryanslikesocool

    ryanslikesocool

    Joined:
    Jul 31, 2016
    Posts:
    49
    It seems that's not the end of my problems. I've tried testing on Windows with MockHMD again. I'm getting errors this time, but they're not helpful in the least. The culprit appears to be
    UNITY_TRANSFER_INSTANCE_ID
    , or at least commenting it out stops the vague errors, but Single Pass Instanced rendering is still broken. The shader in its entirety can be found on GitHub here.
     

    Attached Files:

  5. ThomasZeng

    ThomasZeng

    Unity Technologies

    Joined:
    Jun 24, 2019
    Posts:
    85
    ryanslikesocool likes this.
  6. ryanslikesocool

    ryanslikesocool

    Joined:
    Jul 31, 2016
    Posts:
    49
    It's an improvement! The right eye is rendering now, although without the effect. The left eye is magenta. I'm still getting that error from before, unfortunately. I've updated the repository on that same branch located here.
     

    Attached Files:

  7. ryanslikesocool

    ryanslikesocool

    Joined:
    Jul 31, 2016
    Posts:
    49
    I've finally fixed the underlying issue with the shader. I had to use Multi Pass instead of Single Pass Instanced, which is unfortunate, but it works. The biggest thing was instead of passing in a single position for the sun object, I had to pass in the position, then transform it with a matrix from each eye.
     
  8. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    727
    In this script, they access the field "xr" in the class CameraData. This is a protected field, so developers outside of Unity are not able to use this without forking URP. Can this please be fixed as SOON as possible? Thanks.
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Surprised it wasn't caught in tests.
     
    funkyCoty likes this.