Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Anti-Aliasing PERFORMANCE in VR (Quest 2) in LTS 2021.3.0f1

Discussion in 'VR' started by Vanz, Apr 27, 2022.

  1. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    From all I’ve read and watched on anti-aliasing, the general consensus is to use MSAA 4X in VR and we’ll see little drop in performance, I’m not seeing this in reality, would really like to know what you all are seeing or if I have some settings wrong (my settings are below).

    I created a few cubes in a simple fresh URP project, only 20x20 = 400 using a 512 x 512 texture and then tested again with a 32 x 32 texture

    Case 1 uses 512 x 512 texture
    No AA = 70 FPS
    MSAA 2X = 43 FPS
    MSAA 4X = 30 FPS (more than ½ drop in FPS!)

    Case 2 uses 32 x 32 texture
    No AA = 73 FPS
    MSAA 2X = 45 FPS
    MSAA 4X = 31 FPS

    See below APK file so you can you yourself on your Quest 2 and mp4 video (watch AA change and then FPS). Press the “B” button on the right controller to change to MSAA 4X and no AA.

    One thing to note is that my FPS calculator does not match OVR Metrics at MSAA 4X, that is why I have 2 counters, I calculated with 2 different algorithms (similar concepts). Not sure why OVR is so off from mine, but I think I believe OVR more as mine don’t seem to update as often with MSAA 4X kicks in. (30 vs. 72 at MSAA 4X)

    Thanks for any input or recommendations on this. I’d really like to figure this out, as this is exactly what I see in my game!

    Video (watch AA change and then FPS) = here
    APK Case 1 = here
    APK Case 2 = here

    Vanz

    ps. Note, I posted something like this a little while back but wanted to get new data from LTS. Also, the is with a fresh URP project while before was with everything in my game disabled, so less noise is this study.
     
    korinVR likes this.
  2. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    Pic of STATs and the setup


    Pic of profiler with no AA on Laptop with Link cable,


    Settings,








    Simple texture/sprite used,
     
  3. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    Note study done with Multiview not MultiPass for APK Build
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    Use the profiler on your android build to get proper readings on what is happening.
    Also disable automatic graphics API and switch around vulkan and opengl (and enable the opengl optimization in the oculus tab)
     
  5. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    Switching around GLES3 and Vulkan fixed this, this kinda seems like a Unity bug to me.

    If I have GLES3 added only , MSAA 4X working close to NO AA
    if I have GLES3 added and Vulkan added , MSAA 4X working close to NO AA
    but if I have Vulkan added first then GLES3, MSAA 4X goes to complete crap (by first I mean top of the list)... really weird to me, is this documented anywhere, I could not find?
    Vulkan by itself also MSAA 4X = bad

    Now when I go to GLES3 and multiview I get this weird psychedelia overdrawing effect (will create a post and show). If I use Vulkan and multiview no problem, but the bad MSAA 4X

    Thanks for suggesting this path DevDunk, did not seem intuitive to me... nice youtube vids, I added a like for them, thanks again...

    Vanz
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    Thanks!
    There currently is an issue with Vulkan, depth pass and AA. I suggest making a bug report for it so they can fix it (first try 2021.3.1f1, since it might have a fix for it?)
    A video of the overdraw issue will definitely help yesh
     
  7. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    Weird drawing effect with GLES3 and multiview = here
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    I highly recommend checking if 2021.3.1 still has the performance issue with vulkan.
    Vulkan is good to be in for late latching and spacewarp suppport
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah Vulkan should be fine on latest but it *is* a bug if MSAA is slow on Vulkan - please report that scenario. If you have several renderers in the list, it will pick them in order, so if Vulkan is first and it's slow but not if it's second, it just means the problem is a bug with Vulkan and reporting it will help.
     
    GoesBy and DevDunk like this.
  10. Fairennuff

    Fairennuff

    Joined:
    Aug 19, 2016
    Posts:
    88
    Hi there! I'm on 2021.3.5f1 and noticing this bug as well. I only have GLES3 setup (no vulcan in player settings) and if I do a build with MSAA 4x enabled my frame rate is around 45 FPS in a completely empty scene with nothing but a plane (not even a skybox). If I disable MSAA and rebuild it runs at a normal 72 FPS.

    Unity 2021.3.5f1. URP 12.1.7. Oculus integration v40 (also tested with v41).
    I use the Balanced URP settings that come in the URP core template.

    Did anyone ever figure this out?
     
    GoesBy and th3z0d1ac like this.
  11. BrianDuffyGames

    BrianDuffyGames

    Joined:
    Sep 16, 2018
    Posts:
    9
    Had the exact same problem on 2021.3.5f1, swapped the order so Vulkan is below OpenGL as suggested here and immediately went from 36-58fps in an empty scene to 72. Incredible that this hasn't been fixed.
     
    trojant likes this.
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    Try 2021.3.14 + openxr 1.5.3 + latest oculus xr plugin? (And latest oculus integration if used)
    I thought they had it fixed already.

    If not, disabling depth might also fix it
     
  13. paezguerraalvaro

    paezguerraalvaro

    Joined:
    Oct 16, 2017
    Posts:
    9
    I have the same problem with MSAA in OpenXR. I can confirm it's not fixed on 2021.3.18f1 yet. This is the only thing keeping us in the 2020 LTS. I found out that this same issue was reported back in June 2022, but it's still marked as "under consideration for 2021.2.X".
    https://issuetracker.unity3d.com/is...s-quest-build-when-msaa-is-set-to-2x-4x-or-8x
    I would appreciate if I could get any update on this. As it stands right now, OpenXR is unusable in the 2021 LTS, as applications struggle to hit even 72FPS with minimum visual quality levels. In my testing, the performance loss was so severe that disabling MSAA made the FPS jump from 60 to 90.
     
  14. paezguerraalvaro

    paezguerraalvaro

    Joined:
    Oct 16, 2017
    Posts:
    9
    It seems like the issue I linked in my previous post has been resolved as "Won't fix", as they claim they cannot reproduce the issue.
     
  15. GoesBy

    GoesBy

    Joined:
    Aug 24, 2021
    Posts:
    6
    Same problem on 2021.3.20 + URP 12.1.10 , Multiview & MSAA 4x
    Build same scene in vulkan, set MSAA to 4x, FPS is very low. If no MSAA, FPS is fine
    GLES is fine
     
  16. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    Update Openxr to 1.6 and oculus xr plugin to the latest.
    If it still happens:
    Please make a bug report with the project attatched. I personally cannot reproduce it for example
     
  17. GoesBy

    GoesBy

    Joined:
    Aug 24, 2021
    Posts:
    6
    Hi, I used to using [XR Plugin ManageMent 4.2.1] [Oculus XR Plugin 3.0.2] [PICO Integration 2.1.1] to build APK for Quest2 and Pico 4.

    If add [OpenXR Plguin 1.6.0] to project, build apk error with
    upload_2023-3-8_10-56-45.png
    According to Error Info , I tried to find Ocuclus->Tools->OpenXR Menu, but it's not exist.
    upload_2023-3-8_10-57-41.png
     
  18. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    1. Update oculus XR plugin
    2. Update unity to latest 2021.3
    3. Update oculus integration

    You don't have to use OpenXR if you don't want to, but if you don't see the openxr option ur running an old oculus integration for sure
     
  19. GoesBy

    GoesBy

    Joined:
    Aug 24, 2021
    Posts:
    6
    Thanks for your reply! I found some step to reproduce the issue.

    1.Create a default 3d urp project with Unity 2021.3.20f1, URP 12.1.10
    2.Import XR Plugin Management 4.2.1, XR Intergration Toolkit 2.2.0, Restart Editor
    3.Import XR Intergration Toolkit samples [Start Assets] and enter into Demo Scene. Add a TMP Text to Display FPS and add a quad background to increate rendering consume.Add a toggle to switch MSAA.
    4.Switch Platform to Android, Go to Project Settings-> XR Plug-in Management -> Android Settings, and select Oculus
    5.Enable MSAA4x in URP-Balanced settings, remove SSAO render feature, endable Depth Texture. Add a Bloom Postprocessing
    6.Build Scene to Quest 2

    the scene looks like this
    upload_2023-3-8_16-11-22.png

    Heres the result:
    Vulkan with MSAA: 56 FPS, without MSAA : 72 FPS
    GLES with MSAA : 72 FPS, without MSAA : 72 FPS
     
  20. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    1. With that you can already make a bug report, as it shouldn't differ that much. Make sure to add the steps and link this thread
    2. Looking for fixes: check the depth priming mode in the urp renderer asset and play around with the settings there.
    2.1 bloom kills performance on quest, but should do the same for both backends
     
  21. GoesBy

    GoesBy

    Joined:
    Aug 24, 2021
    Posts:
    6
    Here's the issue. If set depth priming mode to auto, enable depth texture, MSAA. FPS is very low in vulkan.
     
  22. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    I get that, but trying stuff like force prepass might help. And msaa and depth priming is known for bad performance, hence the tooltip.
    But I already said, you can make a big report for it to be looked into