Search Unity

Question Antialiasing for Trees in Oculus Quest 2

Discussion in 'VR' started by twerres, Jan 1, 2021.

  1. twerres

    twerres

    Joined:
    Dec 30, 2020
    Posts:
    6
    Hi!
    Im quite new in Unity so I guess this topic is old for most of you. After reading a lot of sources I didnt make noticable progress in optimizing the tree meshs. On a distance the leafs broke and jiggle constantly. Close to the tree the edges get more smoother.

    What is my missing knowledge?
    I tried
    Is the shader the key? If so, is there any good doc to start with?
    Thanks!

    Windows 10
    Connection via link cable
    Oculus Quest 2
    Unity 2020.2
     
    Last edited: Jan 2, 2021
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    First, note that when you're connected to Windows with a Link Cable, you're probably not running a Quest app; you're running a Windows app (with the Quest used merely as a display and input device). Be sure your build platform is set to Android, and you're actually installing the app onto the headset to test it out.

    The main tip from the Oculus article above is to turn on 4X MSAA. If you've set your build settings correctly (from the first link), you probably already have that. Most of the rest of it is about textures, which I don't think you're talking about — probably you are looking at the edges of actual geometry or alpha cutouts (leaves), not anything to do with texture sampling per se. (Though some screen shots would help us to be sure!) Nothing in this article deals with that.

    The only way to reduce aliasing on such edges is to use something like an alpha-to-coverage shader, as described here. But in my experience, such shaders are too expensive to use on Quest on realistic scenes. So to some extent we choose to just live with the crawly edges. Most players will not complain if the game itself is interesting.
     
    twerres likes this.
  3. twerres

    twerres

    Joined:
    Dec 30, 2020
    Posts:
    6
    Thanks Joe!
    I assume I am actually testing on the headset and not on Windows if I set the Quest 2 as "Run device" in the Build Settings. Also Android as the platform is set. If I missed something here to get it on the headset, thanks in advance!

    The linked article is great! Interesting that the general MSAA settings cant help. I already was surprised that higher settings didnt make the edges smoother. I will definitely look for alpha-to-coverage shader.

    The thing what I am wondering about is that I can actually change Anti-Aliasing values with acceptable results via Post Processing. I went through this video: www.youtube.com/watch?v=jrgN_71s_Go. But this only works on the normal camera, not on the OVRPlayerController:




    If someone has an Idea to get this working on the OVRPlayerController I would be very lucky. Anyhow I will look after alpha-to-coverage shader.

    Best,
    Thomas
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Post processing would kill your framerate on Quest. With a few exceptions (like a simple color shift), give up on that idea.
     
    twerres likes this.
  5. twerres

    twerres

    Joined:
    Dec 30, 2020
    Posts:
    6
    FaberVi and JoeStrout like this.
  6. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    You use URP?