Search Unity

Jittery motion on Oculus Quest

Discussion in 'VR' started by Fingerbob, May 24, 2019.

  1. Fingerbob

    Fingerbob

    Joined:
    Sep 6, 2014
    Posts:
    24
    Good morning! I've recently ported one of my prototypes to Oculus Quest, and I've noticed that objects moving in the scene go through phases of smooth motion for a few seconds, followed by jittery motion for around a second, then repeating.

    I've reproduced this with a super-simple project - one object in scene, bouncing left and right by modifying the transform directly, application.framerate set to match XRDevice.refreshRate, Time.fixedDeltaTime set to match XRDevice.refreshRate. I've logged a bug report for it (1157271). I've tested on 2019.1, .2b and .3a and get the same results.

    The issue seems to be related to FixedUpdate not being stepped correctly - looking in the profiler, the smooth sections will have one set of fixed*** calls per frame, and the jittery section will alternate one frame of fixed*** then one frame where fixed*** don't appear, for 40 or so frames.

    If I set physics.autoSimulate to false, and manually tick physics.Simulate, the same issue happens (although the profiler graph looks different).

    If I set physics.autoSimulate to false and don't tick physics.Simulate, the issue goes away (but obviously nothing physics-related works, e.g. collisions or RBs).

    Is anyone else seeing this behaviour on a Quest device?
     
    ROBYER1 likes this.
  2. SchneiderHiQ

    SchneiderHiQ

    Joined:
    Jul 12, 2017
    Posts:
    4
    Sounds like some general desync issue rather than something related to the Quest specifically. With the variable nature of rendered frame times and the fixed rate of the physics engine what you're seeing is something where the timestepping sort of resonates with itself.
    I'd suggest not matching the fixed timestep to the framerate as closely as you are, as I think this is the primary source of your issues.
    If you feel your physics objects still behave jittery you can enable interpolation on the rigidbodies.
    Otherwise, if you're manipulating transforms use Update rather than FixedUpdate to move them around. Respectively manipulating Rigidbodies should be done with Rigibody.MovePosition/MoveRotation in FixedUpdate so interpolation can do its work.
     
  3. Fingerbob

    Fingerbob

    Joined:
    Sep 6, 2014
    Posts:
    24
    I followed exactly that line of thought, Schneider - I tried syncing the fixedDeltaTime slower and faster by various amounts (e.g. FDT at 71 vs DT at 72, FDT at 60) - they gave expected results during the smooth range (e.g. one missed fixed*** every second, one missed fixed*** every 6 frames) but exhibited the same bad behaviour during the jittery time window (alternating frames show no fixed***).

    I've replicated this in a scene with a single GO (a sphere), transform being moved in Update(), no rigidbody attached. Same issue. Profiling shows (on device) it's running everything apart from the wait in well under 5ms, 70%+ in XR.waitForGPU so it doesn't look like a performance related stall.

    I've tried setting vsynccount to 0 and 1, but that doesn't seem to make any difference. The only thing that makes the issue go away seems to be not calling Simulate.
     
  4. SchneiderHiQ

    SchneiderHiQ

    Joined:
    Jul 12, 2017
    Posts:
    4
    If you're seeing the same jitters doing just the transform in Update it doesn't sound like it's related to the physics engine stuff, almost sounds more like a vsync issue, but you've tried tampering with that as well. Don't really know what it could be then, sorry.
     
  5. Fingerbob

    Fingerbob

    Joined:
    Sep 6, 2014
    Posts:
    24
    I've just tried a build to SteamVR (running on Vive) on PC. I'm seeing the same issue if the game window is fullscreen and has focus! the timing on the jittery window is smaller (1/3 sec every second or so, instead of 1 sec every 3 seconds) but it's the same behaviour.

    It goes away if the game window is windowed (with or without focus) or fullscreen but backgrounded (e.g. when I've got the editor foreground with the profiler running). Very strange indeed.
     
  6. weaverfish

    weaverfish

    Joined:
    Dec 5, 2016
    Posts:
    11
    I've been having a very similar issue for the last couple of days - it's been driving me up the wall.

    Similarly, I did a quick Quest port of a desktop VR game I've been working on and noticed a persistent jitter when moving 'held' items (tracked to controller physically by modifying rigidbody velocity & angular velocity during fixed update). In my case the jitter is there most of the time with brief periods of clarity. (A bit like a resonance as mentioned above).

    I've encountered similar judder on desktop before but it was always resolved by matching the fixedDeltaTime to the hmd refresh rate, or related to reprojection.

    I've been messing around with interpolation, execution order, timesteps but whatever I do, the jitter remains.
     
    kotoezh and ROBYER1 like this.
  7. weaverfish

    weaverfish

    Joined:
    Dec 5, 2016
    Posts:
    11
    Just FYI, downgrading unity to 2018.3.14f1 fixed this issue for me immediately.
     
  8. Fingerbob

    Fingerbob

    Joined:
    Sep 6, 2014
    Posts:
    24
    Great into Adam, I've just tested the example project I logged with the bug, and the issue goes away for me too (2018.3.14f1). That suggests it's a behaviour change in Unity, and worth pursuing to resolve.
     
    ROBYER1 likes this.
  9. buribalazs

    buribalazs

    Joined:
    Jan 2, 2018
    Posts:
    2
    I can confirm that the issue is still present in 2019.1.4f1. Reverting to 2018.3.14f1 solves the issue
     
  10. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    310
    Just trying an almost empty scene on my Quest, with a standard OVRPlayerController, and I see jittery motion in general, even simply moving the head around. I'm using 2019.1.4f1 now but don't really feel going back to 2018.x.x in this moment, this was just a random experiment after all. But I hope for a fix soon, I still want to try some stuff on Quest during the next days.
     
  11. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    Anybody logged a bug report yet? Seeing the same issue in 2019.1.x on Quest
     
  12. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    Same issue here
     
  13. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    @Fingerbob, can you provide a link to this bug? We could vote for it.
     
  14. Fingerbob

    Fingerbob

    Joined:
    Sep 6, 2014
    Posts:
    24
  15. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    Awesome. Thank you!
     
  16. Fingerbob

    Fingerbob

    Joined:
    Sep 6, 2014
    Posts:
    24
  17. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    @Fingerbob, can you send me your repro project? I will send it directly to Oculus for review. Maybe it will speed things up.
    I will send you my email by PM
     
  18. Snorkel

    Snorkel

    Joined:
    Dec 3, 2012
    Posts:
    37
    Did anyone manage to fix this or find a workaround ?

    I made a character controller that runs smooth on Rift S on Unity 2019.1.8
    But on Quest it stutters, almost looks like edges of walls appear transparent cause it misses every other frame or something.
    *framerate and regular head movement is smooth, just like posts above.

    Does this mean any version beyond 2018.3 is unusable for Quest development ?
     
    ROBYER1 likes this.
  19. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Using VRTK v4 I have also noticed when using free Axis (Smooth Locomotion) Movement, the player movement can suddenly stop or begin to move in a direction (almost randomly) for an unlimited amount of time and no way to stop it by pushing the analogue stick in the opposite direction to the constant movement. It just gets stuck and sometimes movement stops working completely.

    Whereas the same scene works fine using a WMR headset on the PC in editor, same controller inputs everything. Odd.
     
  20. williamj

    williamj

    Unity Technologies

    Joined:
    May 26, 2015
    Posts:
    94
    Hi everyone,

    This has been fixed and will land in:

    2019.3a12
    2019.2.1
    2019.1.13

    Thanks for your patience and help!

    -Will
     
    Last edited: Jul 31, 2019
  21. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Can you confirm if the fix is implemented in 2019.3.0.a12? I am still noticing this jitter in a project using that version

    Edit: I have submitted a new case bug report for this at Case ID 1178806, the jittering is severely affecting an app we have in development, on all PC VR platforms it runs just fine and I created a small example scene to demonstrate the issue.
     
    Last edited: Aug 23, 2019
  22. BuzzLightyear

    BuzzLightyear

    Joined:
    Sep 18, 2012
    Posts:
    3
    Hi there we still have this issue with 2019.2.4f1
    We couldn't go back to 2018.whatsoever. We tried a lot of stuff with different time settings (e.g. 1/75, 1/120, 1/150)etc.
    Is there still a an open Case for this? (Didn't find1178806)
    Or has someone a workaround on this? (e.g. exact time settings)
    Any help is appreciated as we have a Beta launch on 15.11.2019

    THANKS and Regards
    Rolf
     
  23. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    You're sure it's not related to performance? We were recently using 2019.2.4f1 and we didn't have this issue.
     
  24. BuzzLightyear

    BuzzLightyear

    Joined:
    Sep 18, 2012
    Posts:
    3
    Hi Benjaminlaner,

    yes pretty sure it can't be a performance issue due to too many tris or special effects (Just leaving 2 Objects with about 10k tris and 2 textures 2K each. Change from LWRP to old school shaders. No chance) We then use a simple controller without rigid body and the whole scene (without occlusion culling) has nearly 130k tris and about 6 materials with 2k textures and runs absolutely smooth.
    Also to note on that... if you use rigid body and don't move (transform or apply physics) to the rigid body the look around in vr is totally smooth.
    We think it has something to do with physics timing increase by unity which can't be really match with the time setting in the player settings.

    We appreciate any ideas and comments.

    Thanks
     
  25. weaverfish

    weaverfish

    Joined:
    Dec 5, 2016
    Posts:
    11
    @BuzzLightyear
    Have you tried fixing the physics timestep to match the display refresh rate (every frame)?
    e.g. put this in a script somewhere in the scene

    Code (CSharp):
    1.  
    2.         void Update()
    3.         {
    4.          
    5.             if (XRDevice.isPresent)
    6.             {
    7.                 Time.fixedDeltaTime = (Time.timeScale / XRDevice.refreshRate);
    8.             }
    9.             else
    10.             {
    11.                 Time.fixedDeltaTime = Time.timeScale / 60.0f;
    12.             }
    13.  
    14.         }
    15.  
    This also allows for slow motion effects, and when testing without an HMD
     
    wm-VR, MoMonay and Aeoth like this.
  26. keithfrechette

    keithfrechette

    Joined:
    Oct 24, 2019
    Posts:
    4
    I'm still struggling with this as well, on build 2019.2.10f1. None of the proposed work-arounds seemed to accomplish anything noticeable.

    Is the Unity team still thinking that this issue is resolved? If so, do we need to open a new issue against the latest builds?
     
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You should open a new issue if it still affects you.
     
  28. williamj

    williamj

    Unity Technologies

    Joined:
    May 26, 2015
    Posts:
    94
    Yes, if you are still seeing this please open a new bug report! Post this issue number here and I will take a look.
     
  29. nomand

    nomand

    Joined:
    Dec 23, 2008
    Posts:
    44
    I'm having the same issue in 2019.3.0b12, it looks like it's caused by Multiview single pass rendering. When using MultiPass, the motion is buttery smooth, but it only renders to Left eye ¯\_(ツ)_/¯
    Still aiting for a fix.
     
    ROBYER1 likes this.
  30. nomand

    nomand

    Joined:
    Dec 23, 2008
    Posts:
    44
    So 2019.3 is out and MultiPass still only renders one eye and Multiview is still unusable.
     
    ROBYER1 likes this.
  31. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    22
    Apparently this is still an issue in 2019.2.16f1. I was banging my head against the wall until I found this forum. No issues when trying via Oculus Link, but if I deploy to Quest -> stuttery hand movements when holding stuff in my hand.
     
    MarkSharpe likes this.
  32. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That'd be because you're dropping framerate under 72fps. At that point it's running on mobile, not desktop hardware.

    Unless you're good at doing 3k resolution mobile games, you're not going to get that far. I have been developing on quest fine in Unity, in fact since it was possible to do so, a few months now.

    When you press play, it's still using desktop GPU.
     
  33. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    I am facing the same issue. Any update on this?
     
  34. nomand

    nomand

    Joined:
    Dec 23, 2008
    Posts:
    44
    Our team did some digging and if you build with IL2CPP and read the debug info from android debugger, there are OpenGL illegal operation errors galore, multiple times a frame when using Multiview. Something is severly broken. Debug is clean on Multipass (which still only renders in left eye).

    Still waiting for Unity to fix this
     
    gjf likes this.
  35. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Please do report it as a bug using the Unity Bug Reporter and post the case number back here, I'll help chase it as I would also like them to fix that!

    https://unity3d.com/unity/qa/bug-reporting
     
  36. nomand

    nomand

    Joined:
    Dec 23, 2008
    Posts:
    44
    Universal RP 7.1.8 fixes this issue. Haven't verified through debugger, but the jitter is gone in a new build I did just now.
     
  37. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    But I am using LWRP. The jitter is still there. Any update on this?
     
  38. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    I removed LWRP and added URP, all I am getting is black screen when using Multi-Pass.
     
  39. nomand

    nomand

    Joined:
    Dec 23, 2008
    Posts:
    44
    Multi-pass is broken, try Multiview
     
  40. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    Multi-view works but it jitters alot which is why I am looking for multi-pass because it runs smoothly.
     
  41. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    Also there is no multi-view option in Unity 2019.3.0 and no Universal Render Pipeline in Unity 2019.2.13f1, I am using LWRP instead.
     
  42. nomand

    nomand

    Joined:
    Dec 23, 2008
    Posts:
    44
    Lol the official 19.3 release Multiview is still Jittery, and now Multipass is not only rendering in left eye, but is jiterry as well.
    Well done
     
    Shirzad likes this.
  43. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    Seriously? Still no fix for this??
     
  44. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    What's your physics timestamp setting for your project?
     
  45. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    For me its just black screen on Oculus Quest (not even splash screen), neither multi-view nor multi-pass works. Just black screen. I am using XR system and not legacy one.
     
  46. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Unfortunately it's probably because the announced Vulkan Support for Multiview on Quest/Go is not actually working properly.

    Can you report it using the Unity Bug Reporter and post the Case number back here please?
     
  47. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    But I am using Color space : Linear and Graphics APIs as OpenGLES3.
     
  48. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    That combo should definitely work, worth reporting it still as it sounds like a bug.
     
  49. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    Actually when I create a new project it works properly, only when I upgraded my old project to latest version I get this error. It can't be related to my project right? Since it was atleast working in the older version.
     
  50. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Try deleting your library folder (make a backup) and reimporting the project