Search Unity

What's the best way to achieve antialiasing in VR (Oculus Rift S and Quest)

Discussion in 'VR' started by bmoodyP3, Jul 26, 2019.

  1. bmoodyP3

    bmoodyP3

    Joined:
    Jul 23, 2019
    Posts:
    12
    Hi All,

    I'm currently building a VR application for the Quest and Rift S.

    However, I am having a hard time getting rid of jagged edges in my scene, especially with UI elements.

    I have already tried:

    1. Increasing the antialiasing settings in Project Settings / Quality / Rendering / Antialiasing. Antialiasing is currently set to 8X multi-sampling.
    2. Adding an antialiasing effect via Unity's postprocessing stack.
    3. In the UI's canvas scaler, setting the Dynamic Pixels Per Unit to a high number.

    Do you have any other advice for achieving antialiasing in VR?

    My understanding is that the Light Weight Render Pipeline can be good for rendering mobile VR games, such as for the Quest. Would switching to the LWRP at this point help solve this antialiasing issue? (I don't think they are connected but I figure it is worth asking.)
     
    AlanMattano likes this.
  2. Skeketor23

    Skeketor23

    Joined:
    Apr 6, 2019
    Posts:
    49
    I'm also fighting with aliasing on the Quest. And I'm using LWRP. Don't think that it will help ;)
     
  3. chakravarthye

    chakravarthye

    Joined:
    Mar 1, 2019
    Posts:
    4
    I am developing VR for oculus rift S. . . . . The biggest problem is the anti-aliasing.

    I have tried these two options:
    1. CTAA from assetstore. This one works but produces an overall blurry output.
    2. Madgoat SSAA from assetstore: This one improves the output slightly but it brings down the performance considerably.

    I am considering testing ont VR in unreal also to find out if is any better.
     
    AlanMattano likes this.
  4. Elin42

    Elin42

    Joined:
    Oct 21, 2014
    Posts:
    22
    @Skeketor23
    Are you using the Oculus Integration from the asset store?
    When I try to use the oculus prefab I only got a black screen on the quest. But when using unity's XR rig everything is fine. The problem is, that I can't code and need the locomotion system from the oculus controller
     
  5. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Oculus recommend using 4x MSAA
     
    GabrielMachadoGomes and dherault like this.
  6. AccentDave

    AccentDave

    Joined:
    Nov 16, 2015
    Posts:
    43
    Would you mind leading us through that? I've found several posts which say this, but all seem to be somewhat incomplete or out of date, and in any case assumes the developer is very savvy about all settings involved.
     
  7. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    project settings > quality > Anti Aliasing
     
  8. darkesco

    darkesco

    Joined:
    Mar 19, 2015
    Posts:
    61
    So does anti aliasing work on LWRP? I really like shader graph, but setting AA to off or 8X in the pipeline asset appears to have no change on Quest.
     
  9. nomand

    nomand

    Joined:
    Dec 23, 2008
    Posts:
    44
    Tested both on URP and LWRP in 2019.2.12 and 2019.3, set AA to 4x in the Scriptable Pipeline file (according to Oculus developer portal). On the main center camera, turn MSAA settings to "use pipeline", go to OVRManager and uncheck the Antialiasing settings there to make sure that pipeline doesn't get overriden.
    make sure that your main camera is actually tagges as Main Camera.
     
    SladeCU likes this.
  10. SladeCU

    SladeCU

    Joined:
    Mar 25, 2019
    Posts:
    6
    ^ This works- going into the center camera and make sure MSAA says "Use Graphics Settings." After that, make sure you do what hawken mentioned above and go into Quality and change MSAA to 4x. If you don't, there should be a dialogue in the camera under the MSAA telling you that you need to change it in the quality settings. I set my quality to Medium and with the MSAA there were no "dancing lines" on hard edges anymore.

    Context: I'm developing on Quest using Unity 2019.2.12f1 with 3D pipeline (not using LWRP).
     
  11. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    I cant find the option to "uncheck the Antialiasing settings". I am using Unity 2019.2.13f1
     
  12. SladeCU

    SladeCU

    Joined:
    Mar 25, 2019
    Posts:
    6
    These are where I found everything. Mine didn't say "Antialiasing settings" exactly, but these are the things I checked and unchecked in the OVRManager script and the center Camera OVRManager.JPG CameraSettings.jpg CameraSettings.jpg
     
  13. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    I have followed the same settings but I still have the problem of flickering meshes. I am using LWRP.
     
  14. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    388
    I also have this problem but this is more obvious when my camera is moving , like slowly following a path. I can't get rid of this problem. My best option is to keep my camera steady which is kind of limiting and boring.
     
  15. unity_llrz2EE34jZn-w

    unity_llrz2EE34jZn-w

    Joined:
    Dec 6, 2018
    Posts:
    1
    Hello,

    I also tried the solution with pipeline, but the problem is when i built the game, there is no .exe file. What am i missing here?

    Thanks
     
  16. JoelLB

    JoelLB

    Joined:
    Oct 9, 2019
    Posts:
    25
    Build with as APK
     
  17. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    481
    I've tested several combinations and found the best one from a performance and visual perspective.

    Set Anti Aliasing to 2x Multi Sampling
    And set
    Code (CSharp):
    1. XRSettings.eyeTextureResolutionScale = 1.5f;
    Unity 2019.4.14f1 with new Unity's XR module

    UPD

    I was wrong. Setting XRSettings.eyeTextureResolutionScale = 1.5f is too much. In my scenario, it takes all performance budget living me only with the nicely rendered scene, where I have no room for gameplay, lol.

    So I do not upscale texture resolution at all. With MSAAx4 it looks... emmm... normal? Of course, it has noticeable pixels but that's a mobile VR headset, you can't expect from it more. I think players won't complain too much about pixels after they will plunge headlong into the game.

    I also saw proposes to disable MSAA completely and only upscale eye texture by 1.5x, but they forgot that MSAA is hardware accelerated, so it's quite cheap for performance. While upscaling eye texture exponentially increases render time.
     
    Last edited: Jan 18, 2021
  18. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    x4 and x8 there is no visible improvement and is not enough.
    wish the x32 option or upscaling image by 2.
     
    fuzzy3d likes this.
  19. CosmicStud

    CosmicStud

    Joined:
    Jun 13, 2017
    Posts:
    55
    Using 4x MSAA definitely takes up about 20-30 percent of the GPU utilization for the quest. Which is very high! Anyone else experience that, tested with 2019, 2020, and 2021 with low settings... Anyone else? Bug? Just me? lol
     
  20. djhatvr

    djhatvr

    Joined:
    Sep 22, 2019
    Posts:
    53
    Same
     
  21. nagyhazi

    nagyhazi

    Joined:
    Jul 8, 2022
    Posts:
    1
    same problem,