Search Unity

Oculus "jitter' in Unity 5

Discussion in 'AR/VR (XR) Discussion' started by hoesterey, Mar 5, 2015.

  1. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    Anyone else experiencing "jitter" when turning their head using the Oculus 0.4.4 in Unity 5?

    Any solutions?
     
  2. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    This typically happens when the framerate drops below 75. In that case, the left and right eye are no longer properly synchronized and the scenes start to stutter. I believe the default implementation has a stats panel bound to the space key by default. If you bring that up, you will see whether the framerate is your issue.
     
  3. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    Thanks! I'll take a look.
     
  4. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    [EDIT] found another forum post. There may be a bug with Gfx.WaitForPresent hitting performance even with Vsync off. Its taking up 85% of my CPU.

    So,

    It seams that my computer is clamping at 60 due to "Vsync" I tried turning Vsync off in the player settings but it still seams to be on. Does oculus auto enable Vsync? Strange it would clamp at 60 and not 75. My comp has 2 GTX 970s in SLI and I'm in greybox so I don't think its a performance issue.
    Thanks for any info!
     
    Last edited: Mar 8, 2015
  5. lovebaggio

    lovebaggio

    Joined:
    Mar 9, 2015
    Posts:
    1
    I did a quick scene build using the default Unity settings and got a buttery smooth output on the DK2 (running on a an iMac with Win7). As soon as I changed the project settings to match those described in the Oculus Unity integration guide for 0.4.4 the build was really juddery.

    *EDIT - I found the issue was the "Use Direct 3D 11" setting in the 'player settings'. With this checked, the playback is smooth but when it is not checked, it judders every second.
     
    Last edited: Mar 9, 2015
  6. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    Are you using the direct to rift mode or the usual desktop mode? Direct to Rift shouldn't give you any issues with Vsynch, since it ignores any monitor settings (which usually can't go higher than 60 Hertz).
     
  7. El Maxo

    El Maxo

    Joined:
    May 23, 2013
    Posts:
    177
    Can you do a test for me, when the editor is in playmode, can you try and then change the zsync?
     
  8. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    82
    I'm migrating my Oculus 0.4.4 + Unity 4.6.2 project to 5.0.

    Last night I noticed that when using Unity 5 my frame-rate gets capped at 60FPS in the Rift in Direct mode, which does not happen in 4.6.2. (My monitor is at 60FPS.) If I switch from DX11 to DX9 I get 75FPS but then Reflection Probes (and who knows what else) don't work. VSYNC is disabled in Quality Settings, of course.

    It seems that Unity 5 has a show-stopping bug with VSYNC on the Rift. Hopefully we'll get a fix and/or some new Oculus support soon.

    All ideas are welcome!
     
    Last edited: Mar 10, 2015
  9. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    Heya,
    I'm not using direct to rift mode. I have not been able to get it to render in Unity when in Direct to Rift mode. Not sure why.

    El Maxo. By zsync do you mean vsync? Or am I missing a setting?
     
  10. El Maxo

    El Maxo

    Joined:
    May 23, 2013
    Posts:
    177
    vsync, sorry
     
  11. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    No luck on that El Maxo. No change from what I can tell.
     
  12. El Maxo

    El Maxo

    Joined:
    May 23, 2013
    Posts:
    177
    sorry to hear, it took me about a month of fiddling to get it right, and I'm not 100% sure what I have done
     
  13. Pete-Moss

    Pete-Moss

    Joined:
    Mar 18, 2013
    Posts:
    15
    As a test, try disabling Hyperthreading. There have been a few reports of judder (i have had a few issues too), and that might help resolve it. I would be curious to know the result.

    We have some VR improvements and optimizations coming Real Soon Now, so the situation should only improve in the near future.
     
  14. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    I know about the new default camera switch which makes enabling Oculus support a flick of a switch. Will Unity's efforts go beyond that? I remember Valve's GDC talk about rendering techniques/efficiency for VR and quite a few things appeared to be engine-related (anti-aliasing techniques, filtering, vsynch handling, etc.). Is Unity going a similar route with its optimizations?
     
  15. Pete-Moss

    Pete-Moss

    Joined:
    Mar 18, 2013
    Posts:
    15
    The short answer is yes, we are working on similar optimizations. We have a long internal list of things to try and things to do. And of course we have some great input on that by guys like John Carmack from Oculus and also the smart folks at Valve. :)
     
    SAOTA and argosy_ops like this.
  16. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    Nice! Looking very much forward to that. Personally can't wait to get my hands on the HTC Vive. I assume your VR optimizations will benefit various HMDs in the end :)
     
  17. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    Good news! Unity5 is much slower than Unity4 when it comes to OculusRift device! I hope it comes very soon :)
     
  18. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,079
    Pete, thanks for the info. It's encouraging to know you guys are still cracking away on Rift stuff. Keep up the great work!
     
  19. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    For me, Unity 4 works very well with Oculus DK2. I am hoping that it will just be a matter of time before a new Asset Package comes out which gives Unity 5 the same ability. For now, I'm just working on the content without testing on DK2. I had limited success testing in Extended Mode.
     
  20. Draco18s

    Draco18s

    Joined:
    Aug 15, 2011
    Posts:
    110
    I found this thread experiencing the same extreme jitter with DK2 on Unity 5.
    I'm disappointed to find that there is no solution yet.
     
  21. JacobK

    JacobK

    Joined:
    Jun 18, 2013
    Posts:
    20
    Try forcing DX11, if this doesn't work, try turning off Time Warp on the OVRCameraController, under some circumstanes this has helped lower jitter / judder for me.
     
  22. Recluse

    Recluse

    Joined:
    May 16, 2010
    Posts:
    485
    I've been using Oculus DK2 with both Unity 4 and 5 and find it jitters when turning the head in the editor.

    Setting Rift to Direct HMD Access in the config utility fixed the jitter for me when running standalone builds on the desktop, but when I run in the editor I get no image in the rift.
     
    Last edited: May 18, 2015
  23. Draco18s

    Draco18s

    Joined:
    Aug 15, 2011
    Posts:
    110
    Did both of those, and every other suggestion I've run across.
     
  24. limping_badly

    limping_badly

    Joined:
    Jun 18, 2013
    Posts:
    1
    Does you solution use physics? I have had persistent problems with motion sickness in a virtual reality wheelchair trainer and jitter was one of the issues that I have tried to fix. We have dealt with much of the motion sickness (see http://mtechgames.com/2015/12/09/physics-and-frame-rate-beating-motion-sickness-in-vr/) and we now have a consistent frame rate of 75 fps but there are still a couple of areas of jitter. Two hints that I received on another forum helped with the frame rate significantly when dealing with physics. Firstly, I set the rigid body of my wheelchair to interpolated. Secondly, I set the time step, and max time where set to 1/75 rather than 1/60. I'm not sure what is causing teh remaining jitter but it seems to be whenever the sky dome is visible.