Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Quest + LWRP/URP: MSAA not working

Discussion in 'AR/VR (XR) Discussion' started by DanjelRicci, Nov 30, 2019.

  1. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    308
    Sorry for the huge delay! I ended up reverting to 2019.x months ago, mostly because URP ShaderGraph performance in 2020.3 was much worse than 2019.x. Right now everything is working for me except for Opaque Texture (if I enable that, MSAA dies) but I'm not using it so I've found my balance. Reflective edges might always be a problem with MSAA I fear, it's still a rather quick AA method after all.
    I will make more tests with Opaque Texture and later 2020.x versions in a couple months probably.
     
    hippocoder and TheVirtualMunk like this.
  2. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    150
    Very interested in hearing if you get Opaque Texture working with MSAA :)
     
  3. bdeschryver

    bdeschryver

    Joined:
    Jun 13, 2013
    Posts:
    93
    What do you mean by no opaque texture ? Isn't the default and standard texture type ?
    After some contacts here and there, it seems URP does not provide a good looking solution at the moment... So disappointed with it !
    thanks
     
  4. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    150
    There's an option in the URP settings Asset to toggle Opaque-Texture (similar to GrapPass). Meaning any shaders using these operations won't work correctly if this is toggled off. Opaque texture is commonly used for refraction shaders, or any shader that needs access to manipulate the screenspace texture behind/around the mesh.
     
  5. pixeleif

    pixeleif

    Joined:
    Feb 9, 2016
    Posts:
    17
    Oh my god, I've read this thread before, but not the last page.
    I've just spent 1 day+ to get to the same answer.
    My issue is only when sideloading/deploying to an Enterprise version of Quest 2.
    The consumer Quest 2 is working fine with MSAA and opaque textures.
    I'm using Crest Water so I really need the opaque textures to work .

    I'm using Unity 2019.4.12, URP 7.3.1, Single-pass rendering.
    Also tried in 2021, URP 11, Multi-view rendering (single-pass)
     
    DanjelRicci and TheVirtualMunk like this.
  6. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    150
    You and me both - also lost a full day of work debugging this.
    Unity/oculus need to get their S*** together and either fix these issues or make an effort to PSA these issues in a central official place for developers to consult.
    I'm subscribed to multiple of these types of threads just to stay updated whenever something new breaks...
     
  7. Halfspacer

    Halfspacer

    Joined:
    Sep 13, 2014
    Posts:
    23
    Is there a ticket for this issue? If not, it would be a good idea to create one. Then both you and Unity can track the issue there instead of having to subscribe to a bunch of messy forum threads.
     
  8. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    308
    Thanks for the details, though I would love to ask more because I believe I'm doing basically the same stuff and it's not working.
    In my case it's Unity 2019.4.16f, URP 7.5.3, Multiview rendering (I don't have Single Pass, is that Multiview right?), and a both consumer Quest 1 and 2. I recall this issue being there with old minor versions of Unity and URP, so I'm not sure downgrading to that would actually help.

    EDIT:
    Just tried this solution... It works, but with terrible performance.
     
    Last edited: Jun 29, 2021
  9. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    150
    Multiview is basically single pass instanced yes.
    As for the other things I can only help by saying OFB/enterprise headsets does NOT run the latest consumer OVR version. Currently conusmer is on v30 while enterprise is on v28. I talked to oculus support about how bad this is for development, and how hard it is to find this information so hopefully they will change something to make that more clear.
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Did you ever find out why that was? Could it have been a bug fixed since? Seems like a worrying regression.
     
  11. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    308
    Thanks, though this doesn't add much about the consumer Opaque Texture issue. In any case after testing the solution by tom_fv, and chatting a bit with other VR devs, we came to the conclusion that Opaque Texture + MSAA failure is not only a bug but also an heavy operation on its own- unless you set MSAA to 2x apparently, by looking at this Oculus doc:
    When I tried I still had MSAA 4x so I need to try again at 2x. In any case this stuff lies beyond my comprehension of how GPUs really work so I'm not going to make more tests than the above.

    Never understood what the issue was. Looks like it's fixed in 2021.1 though, but the issue still persists in the 2020 LTS. Sticking to 2019 LTS for now, seeing how this was (or was never) addressed is pretty depressing.

    EDIT: added link to issue case fixed in 2021.
     
    Last edited: Jul 1, 2021
    Beauque and hippocoder like this.
  12. sg07_ri

    sg07_ri

    Joined:
    Jul 16, 2021
    Posts:
    1
    I've been struggling the past few days trying to figure out why MSAA shouldn't be working on Oculus Quest when using URP (it works fine in editor though). I've tried different solutions
    My current setup
    Unity 2020.3.8f1 (64-bit)
    URP 10.5.1
    OculusIntegration v29

    OVRManager:
    Use Recommended MSAA off.
    Same camera settings as below Camera Settings.PNG URP Settings.PNG
     
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    AFAIK there was an MSAA bug fix recently, so that's worth a search.
     
  14. mosabsaraireh

    mosabsaraireh

    Joined:
    Mar 28, 2021
    Posts:
    4
    Hi, is the URP and MSAA problem solved yet???
    for version 2021.1.22f1
     
    Last edited: Apr 12, 2022
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Is there a problem? I see no problem with it and use it daily.
     
  16. mosabsaraireh

    mosabsaraireh

    Joined:
    Mar 28, 2021
    Posts:
    4
    I'm countering a problem with the environment quality for oculus quest 2, I'm using Unity 2021.1.22f1 and URP 11.0.0, its like this photo, I'm using MSAA (8X) on URP High Quality, but I still have jagged edges when I'm far away from objects also these objects are flickery, any suggestions to solve this issue ????
     

    Attached Files:

    • 11.jpg
      11.jpg
      File size:
      672.6 KB
      Views:
      300
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It looks to me that MSAA is simply not working in your case... (also 4x is the recommended for Quest2). Are you using deferred or forward? MSAA will never work on deferred.
     
  18. mosabsaraireh

    mosabsaraireh

    Joined:
    Mar 28, 2021
    Posts:
    4
    I tried the 4x MSAA, also I checked in my graphics settings it's on forward renderer
    here is my settings:
     

    Attached Files:

  19. mthawley

    mthawley

    Joined:
    Sep 7, 2018
    Posts:
    104
    I switch off Depth texture, Terrain Holes and HDR - MSAA works correctly. Maybe worth a try.
     
  20. RobertCoomber

    RobertCoomber

    Joined:
    Mar 25, 2017
    Posts:
    15
    For anyone looking to do this on later unity versions, I have the correct checkbox sequence to get MSAA antialiasing working on quest 2.

    Unity 2021.3.4f1
    URP 12.1.7

    URP Settings
    MSAA 4X
    HDR false
    Depth texture false
    Terrain holes false

    Project Settings
    Set my URP Asset in Graphics and Quality
    XRPluginManagement -> Oculus : Stereo Rendering Mode Multiview

    No changes to ForwardRenderer.CS
     
    tom_e_roberts and hippocoder like this.
  21. ReedDAT

    ReedDAT

    Joined:
    Sep 1, 2022
    Posts:
    3

    These settings aren't working for me on Unity 2021.3.8, URP 12.1.7. I am still unable to get MSAA to work on Oculus Quest platform with URP. Without URP, MSAA is fine. Any help is appreciated, thanks in advance.

    I have my Project Settings -> Quality set to use URP-Balanced for its Render Pipeline Asset. I have modified my project URP-Balanced Pipeline Asset to mimic the above settings, as you can see here:
    URPAsset.png

    Here are my Oculus XR Plugin Management settings. Stereo Rendering Mode is set to Multiview:
    upload_2022-9-8_16-14-47.png

    I am able to see the effect of turning MSAA on and off within the editor. Here is the scene with MSAA off:
    0AA.png

    Here is the scene with 4x MSAA on (it looks very nice), from within the editor:
    4xAA.png

    Here is the scene form within the app when deployed to Oculus Quest with 4x MSAA set to on (it looks very bad):
    3169.jpg
     
    PraveenBalu likes this.
  22. ReedDAT

    ReedDAT

    Joined:
    Sep 1, 2022
    Posts:
    3
    For completeness, today's activities have involved deploying the app to multiple devices (Quest 1, Quest 2), in addition to swapping OPENGLES3 for Vulkan (and vice versa). I still have not discovered a combination of settings within Unity3D 2021 that will induce MSAA in an app/game deployed to Oculus Quest platform.
     
  23. ReedDAT

    ReedDAT

    Joined:
    Sep 1, 2022
    Posts:
    3
    Which settings are you referencing, specifically?

    I see two sections that are relevant to MSAA on my camera. The first is the Anti aliasing attribute in the Rendering section of the camera, which has no options for MSAA:
    upload_2022-9-12_9-2-57.png

    The second is the MSAA options in the output section of the camera options, which has settings for "Off" and "Use settings from Render Pipeline Asset" (mine is kept on the latter):
    upload_2022-9-12_9-4-25.png

    My render pipeline asset is set to use MSAA:
    upload_2022-9-12_9-5-41.png
    upload_2022-9-12_9-6-24.png

    MSAA is still not working when my app is deployed to Oculus Quest 1/2.
     
  24. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Put renderscale on 1. That should not be changed for Quest native titles. It will force Quest to render to a texture (which is actually slower at times / might not support MSAA). Instead optimise elsewhere, or use Application Spacewarp.

    Also are you using any oculus libraries directly? You shouldn't mix with Unity's own XR unless you know what you are doing.

    Don't use upscaling on a Quest2.

    Also... terrain holes might cause problems as well, so tick that off too.
     
  25. PraveenBalu

    PraveenBalu

    Joined:
    May 2, 2022
    Posts:
    8
    I am also having same exact issue. I am using archiviZ Pro unity package for VR. After building in headset it has these pixelated jagged edges but not in the game window. I modified most of the settings but still the edges issue coming
    Have you found any solution?
     
    mahmoud93p likes this.
  26. bdeschryver

    bdeschryver

    Joined:
    Jun 13, 2013
    Posts:
    93
    Hey guys,
    I wanted to help here as I have been struggling with this AA issue on Quest (1-2-3) for years now. I did a lot of searches and tests.
    Today I am using Quest3 with Unity 2022.3.14, URP14.0.9 and OpenXR (OpenXR 1.9.1+Oculus XR plugin 4.1.2).
    I have MSAA 4x on working (as I see a big difference when turned off) using the tips and tricks mentioned here above.
    But it is never satisfying.
    This is the same for me using a tethered Quest to a PC (Windows build), so I can't say it is because of URP.
    My feeling is that on Quest you will at this day not get nice smooth graphics with Unity.
    Strangely seen a PC build made on unreal engine and it is the same issue.
    I wanted to think that it is just bad in Quest no matter what, but when you check the home environments for the headset, graphics are very smooth and nice.. How did they achieve that ?

    I also tried increasing render scale and that works of course, but killing your FPS.