Search Unity

Depth Buffer sampling is "late" on right eye with Multi Pass Stereo Rendering VR and URP

Discussion in 'Universal Render Pipeline' started by stephero, Dec 3, 2020.

  1. stephero

    stephero

    Joined:
    Feb 8, 2016
    Posts:
    123
    Hi guys,

    I have an issue when sampling the depth buffer in a VR project using URP.
    I use Unity 2020.1.15 (but the issue occurs in older Unity versions) with XR plugin Oculus (but the problem occurs also with other plugins like OpenVR).

    To sample depth, I use a basic Shader Graph shader:
    Screenshot_26.png

    When using the Stereo Rendering Mode "Single Pass Instanced", everything is fine: the depth sampling is perfectly in sync in both eyes.


    But when using the Stereo Rendering Mode "Multi Pass", the sampling on the left eye is OK, while the right eye is late by a few frames. It might not be very visible in the video, but it's very ugly when moving the head in the HMD. Just pause the video and check the alignment between the depth sampling and the regular rendering:


    Here is a screenshot from the video showing that the sampling in the left eye is OK, while the right eye is not aligned with the regular rendering:
    Screenshot_27.png

    Here is the test project I made if you want to give it a try: https://www.dropbox.com/s/pvkujbf1mkvjxmb/Test_URP_VR_ShowDepth.zip?dl=0

    Is it a known issue? Is there any workaround (apart from switching to Single Pass Instanced)?

    Thank you
     
    Last edited: Dec 3, 2020
    Zehirmann likes this.
  2. Zehirmann

    Zehirmann

    Joined:
    Jan 16, 2019
    Posts:
    1
    Hi,

    I have been having the same issue, except that I am not even able to get a normal depth with single pass instanced. I really can't figure it out, one eye being late on only this one buffer...
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Disabling the "Shared depth buffer" option in the Oculus XR settings does the trick for me. Though as far as I could tell, this also occurs when using Single Pass Instanced