Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    Dismiss Notice

Question URP on Quest 2 Depth Texture enable Destroys the framerate

Discussion in 'Universal Render Pipeline' started by HRDev, Aug 5, 2022.

  1. HRDev

    HRDev

    Joined:
    Jun 4, 2018
    Posts:
    26
    Hello everybody. I am developing a VR game with quest 2 using Vulkan as Graphics api. I need to activate the Depth Txture in the URP settings to do some fog effects. But when I activate this Depth Texture the framerate goes from 90 to 45/50... without doing anything else, without adding anything to the scene, just activating DepthTexture... it's normal? is there a way to optimize it?

    I noticed that with OpenGLES3 it is better, should I make the switch to OpenGLES3? I prefer to avoid...
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    1,563
    There indeed is an issue with vulkan and depth which is really annoying. I assume you are using Unity 2021? (2020 doesn't have this issue afaik)
    If so, have you updated to the latest release already?
    OpenGLES can definitely have better performance, so if your game does run with all your requirements on it definitely use it. Oculus is pushing vulkan with new features like phase sync, but it's not required
     
  3. rjonaitis

    rjonaitis

    Unity Technologies

    Joined:
    Jan 5, 2017
    Posts:
    115
    The issue is known and already being worked on, the Vulkan's performance drop is caused by URP's depth copy pass if MSAA is enabled.
     
    DevDunk likes this.
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    1,563
    I think in the past someone already found the PR causing the issue. Is there any ETA for it? Will it be fixed in the 2021 LTS or will ot just be 2022?
     
  5. rjonaitis

    rjonaitis

    Unity Technologies

    Joined:
    Jan 5, 2017
    Posts:
    115
    The issue was caused by optimization change preferring depth copy instead of depth prepass, fix already passed testing and waiting for code merge. I can't give you ETA or backport promises, I'm not working on this case.
     
    Koboct-Denis and DevDunk like this.
  6. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    565
    So the testing shows that just regenerating the depth buffer is faster than copying it in the general cases the team tested?
     
  7. Koboct-Denis

    Koboct-Denis

    Joined:
    Jul 20, 2022
    Posts:
    1
    Hello, any news on the fix?
     
  8. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    558
    On quest 2, the gpu is using a tiled deferred rendering architecture. To copy the depth buffer you need to resolve this texture. Depending on your resolution this can take several ms per copy. If generating a new one costs less than that, it's worth it. Really though, you should avoid needing the depth buffer at all on quest.
     
unityunity