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

Sanity check needed: Does MSAA work in VR? (Unity 5.5.0f3)

Discussion in 'AR/VR (XR) Discussion' started by BlackPete, Jan 25, 2017.

  1. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    Hi,

    I'm using an Oculus HMD, and the Unity Camera with forward rendering. Target eye is both. Nothing fancy.

    I've been tinkering around with the rendering settings, and one thing has me puzzled: When I look at the Quality Settings, and play with the Anti Aliasing setting, I can't really see much of a difference between "Disabled" vs "8x Multi Sampling".

    I still get really jaggy lines in the HMD regardless of what AA setting I use. So here is where I need a sanity check: Is it actually working? Or are the differences just so subtle that I can't see it at all?

    If I look at a cube, and tilt my head to the side a bit and look at one of the sides, it is extremely shimmery, which is undesirable. That's what I'm trying to fix.
     
  2. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    593
    I am not sure that the Quality settings have any effect, I think the Oculus has it's own rendering system and might ignore those. That's just based on what I see when doing the same sorts of things.

    I was wondering, after reading this article, is Unity incorporating any of these ideas into it's latest VR systems:

    https://ustwo.com/blog/vr-distortion-correction-using-vertex-displacement

    Even though this is addressing mobile, it seems like a great idea to apply to desktops as well.
     
  3. Fabian-Haquin

    Fabian-Haquin

    Joined:
    Dec 3, 2012
    Posts:
    231
    Yes it will work but MSAA will not work with HDR.

    You can use Unity builtin MSAA for both Oculus SDK and OpenVR SDK.
    You can even use The Lab Renderer from Valve with the Oculus if you want to.
     
  4. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    Are you referring to the Quality Settings options? Because I can't see any difference between no AA vs 8x multisampling. Am I missing something else?

    I'm not using HDR, by the way.
     
  5. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    That certainly would be unfortunate if Oculus is indeed overriding the AA setting. I hope that's not the case.

    I wonder if another option is to put a RenderTexture on the camera, and set the AA setting on it to force it back to Unity's setting? I may have to experiment with this to see what happens.
     
  6. Fabian-Haquin

    Fabian-Haquin

    Joined:
    Dec 3, 2012
    Posts:
    231
    Well that's weird because I used AA x8 on a project I made with the Oculus but I was using the Lab Renderer, I haven't tried without.
     
  7. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    OK I just created a new project using the default settings, and created a camera, a plane, and a cube. I can see that MSAA definitely worked there, and the difference between no MSAA and 8x MSAA was huge.

    So it seems that MSAA was somehow broken in my app. Now I just need to figure out why or how. o_O
     
    Fabian-Haquin likes this.
  8. Fabian-Haquin

    Fabian-Haquin

    Joined:
    Dec 3, 2012
    Posts:
    231
    Maybe the platform used is different ?
     
  9. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    I had to put this on the back burner for a while to work on other stuff... now I'm back on this.

    So after going back and forth between my project and the new project, I finally figured out what the issue was. It's a bit silly, really.

    The default tier settings for my project had deferred set as the default rendering path. The new project had forward as the default rendering path. I haven't been able to figure out what determines the default settings, or why the defaults are different between these two projects. o_O

    So, to fix this, I override the default settings and changed the rendering paths for all tiers to forward. It feels so strange doing this without knowing why I didn't have to do this in the new project!


    upload_2017-1-31_17-47-27.png
     
    Fabian-Haquin likes this.