Search Unity

Jitter when objects are moving rapidly or attached to the camera

Discussion in 'Daydream' started by b4th, Oct 6, 2016.

  1. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    I'm seeing a significant amount of shake on objects that are either moving quickly through the scene or attached to the camera, such as targeting cursors.

    I've tried everything I can think of to alleviate this issue, but it seems to be associated with the way that the Daydream Technical Preview renders in VR mode. Smoothing animation doesn't appear to help the issue much, it's almost like old frames are being duplicated.

    Has anybody else seen this issue? Any solutions?

    Many thanks.
     
    Last edited: Oct 6, 2016
  2. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    Here's an example project which demonstrates the issue:
     

    Attached Files:

  3. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    Your project reproduces the issue for me. We'll investigate.
     
    b4th likes this.
  4. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    This is related to frequency mismatch of async reprojection and unity's render rate.

    At the moment it looks like we aren't properly throttling at the same frequency as the async reprojection. You can work around this by setting Application.targetFrameRate = 60, it looks good (unless we drop a frame or somehow get out of sync). I've reported this to google and it will be resolved.

    But, at 30 hz it is basically double image. I have a thread open with google to make sure the reprojection is working correctly, but this may just be the nature of reprojection. It works great for static objects, but anything that is headlocked, or animations, will not look smooth. We'll update here if we find out anything.
     
  5. BWerner

    BWerner

    Joined:
    Sep 23, 2016
    Posts:
    13
    I have had similar Issues
     
  6. Deleted User

    Deleted User

    Guest

    Is there a tracking ticket on this bug?
     
  7. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    Good news! This issue appears to be (pretty much) resolved in version 5.4.2f2-GVR13. There may still be very occasional glitches, but the issue is much less noticeable and much more acceptable.

    Many thanks to Unity and Google!

    EDIT: Perhaps not. Objects in the scene appear smoother, but there still appear to be issues with HUD elements or 'reticles'.
     
    Last edited: Dec 16, 2016
  8. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    Thanks for the update, looks like it was fixed with google's 1.10 sdk
     
  9. nbensonleap

    nbensonleap

    Joined:
    Sep 30, 2016
    Posts:
    7
    Still experiencing jitter. 1.10 has had no effect as far as I can tell.

    I'd attach a Unity project, but it would be a camera with a cube attached to it, so I'll provide these steps instead:

    Reproduction steps:

    1) Start a new project in Unity 5.4.2f2 GVR-13 Personal.
    2) Import gvr-unity-sdk 1.10 unitypackage.
    3) Open GVRDemo.unity.
    4) Create a Cube primitive as a child of the Player->Main Camera object.
    5) Shrink the cube a bit, move it forward so it is in view of the Main Camera. Rotate it a bit to have some nice sharp constrasty corners.
    6) Build for Daydream:
    a) Set build target platform to Android.
    b) Edit->Project Settings->Player->Other Settings: Enable VR, choose Daydream SDK.
    c) Set Minimum API Level to Nougat.
    d) Set the GVRDemo scene as the startup scene in build settings.
    e) Plug in Pixel, build and run.
    7) Look around in the scene. Observe cube jitter.

    This jitter still happens when attempting to use different VSync and Application.targetFrameRate settings:

    1) Vsync (On by default).
    A) Try turning Vsync off in Quality Settings.
    B) Try turning Vsync to double.
    2) Application.targetFrameRate
    A) Create a GameObject. Attach a script that calls Application.targetFrameRate = 60 on Start().
    B) Try Application.targetFrameRate = 59. Still no dice.

    Are there some magic settings I'm missing?
     
  10. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    Ah, apologies, you're focusing on the object attached to the camera, whereas I was more focussed on the distant objects moving in the scene. Distant objects seems to be much smoother than before, but you're right, the 'reticle' still jitters quite a bit.

    Perhaps the issue is not as resolved as I'd thought.
     
  11. nbensonleap

    nbensonleap

    Joined:
    Sep 30, 2016
    Posts:
    7
    Unfortunately when I tried the same procedures on your example scene, I observe the oscillating object (not attached to the camera) to jitter in the same way as well. I hope the issue doesn't get marked as resolved on Daydream's end; I just haven't observed any improvement since GVR10.
     
  12. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Hi guys and @thep3000 , as of 5.6.0 beta 4 this issue persists, and I would say it seriously affects quality.
    • more-or-less moving objects appear jittery/sputtering, as if frames are dropped or something impedes their movement
    • this problem is very easy to reproduce, just create an emtpy scene, add a standard sphere at distance 10 from the player and have it move around the player with something like:
    Code (CSharp):
    1. transform.RotateAround(Camera.main.transform.position, Vector3.up, 30 * Time.deltaTime);
    • the problem persists whether Update or LateUpdate is used
    • the problem is selective to Daydream (I'm using the Pixel XL). If I use the same simple project and build it for the Gear VR (with a Samsung S6), the object moves smoothly
    • interesting (in a sad way): this problem also used to occur on Gear VR, I remember seeing it as late as summer 2015, but it disappeared some time later.
    Please Unity, it would be great if you could treat this as a bug, as it really makes certain kinds of games (like ours) look bad.
     
    Arkade likes this.
  13. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    904
    @WendelinReich you should submit a bug report with that simple project attached; it will get far more traction more quickly that way.
     
  14. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Did that now, filed under case number 872723
     
    Arkade likes this.
  15. Yahart

    Yahart

    Joined:
    Dec 27, 2016
    Posts:
    2
    Is this happening also in Unity 5.6.0b4?
     
  16. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    That's what @WendelinReich said:

    I'm just in the process of upgrading from the 5.4 Daydream preview to 5.6.0b4 so expect to see it shortly myself :(
     
  17. sfaok

    sfaok

    Joined:
    Nov 27, 2012
    Posts:
    23
    I have been having the same issue. Quality severely affected, even if app runs at 60fps. Its been there in all the GVR releases, still see it in 5.6.0b4. Its the main barrier to release for me. Same scenes on Gear VR work smoothly.

    I can't find issue 872723 under the bug tracker - can you provide a link?
     
  18. kexar66

    kexar66

    Joined:
    Feb 27, 2013
    Posts:
    48
    Still happening in Unity 5.6.0b5
     
  19. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
  20. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    104
    WendelinReich likes this.
  21. kexar66

    kexar66

    Joined:
    Feb 27, 2013
    Posts:
    48
    Still happening in Unity 5.6.0b6
     
  22. kexar66

    kexar66

    Joined:
    Feb 27, 2013
    Posts:
    48
    Still happening in Unity 5.6.0b7 + GVR Unity SDK v1.20.0.
     
  23. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    I have a fix for vSync that should help resolve this issue in Daydream and Cardboard.. I'm hoping it makes it into b8 but it could be pushed to whatever release is in the pipe after that.
     
    WendelinReich likes this.
  24. nbensonleap

    nbensonleap

    Joined:
    Sep 30, 2016
    Posts:
    7
  25. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    The bug was closed as duplicate if another, earlier reported bug. The fix is not in b8 but should make it into b9.
     
  26. nbensonleap

    nbensonleap

    Joined:
    Sep 30, 2016
    Posts:
    7
    Would you mind posting the link to that earlier bug just so I can observe the ticket? Thanks for the quick reply.
     
  27. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
  28. nbensonleap

    nbensonleap

    Joined:
    Sep 30, 2016
    Posts:
    7
    Looks like that link requires a login
     
  29. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
  30. nbensonleap

    nbensonleap

    Joined:
    Sep 30, 2016
    Posts:
    7
    Update: The bug is not fixed. The jitter occurs in the latest GVR SDK example scene with an object attached to the camera. The jitter occurs without the GVR SDK in a bare-bones scene with an object attached to the camera. The jitter occurs whether vsync is enabled or disabled.

    Gif, recorded from a build made with Unity 5.6b9, in this case in the GVR SDK example scene:
    https://drive.google.com/file/d/0B_w9_hQJupIYWmMwSk02UlhyVVE/view?usp=sharing
    The same project I posted above regarding 5.6b8 also reproduces the issue when upgraded to 5.6b9.

    It's concerning the bug is marked as closed because the bug is not fixed.
     
  31. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    The bug is closed and the fix is in for b10. If you look at the release notes for both b8 and b9 you should see no mention of the fix for this issue being released yet.
     
  32. Dirly

    Dirly

    Joined:
    Mar 24, 2013
    Posts:
    19

    Any update on when the release of b10 is? waiting for this resolve before moving to the beta client.
     
  33. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    I have no eta on that. It's in the works and moving through release management but I'm not in control of or have visibility into the process at that point. :-(
     
  34. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    904
    Looks like right now! :)
     
  35. kexar66

    kexar66

    Joined:
    Feb 27, 2013
    Posts:
    48
    There is absolutely no difference in jittering issue in 5.6.0b10 for me. Do I need to use some specific settings in player settings?
     
  36. Dirly

    Dirly

    Joined:
    Mar 24, 2013
    Posts:
    19
    Seeing the same thing... I just moved my preview build to b10. I'm running a consistent 60fps and still seeing the judder.
     
  37. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Check out the release notes though, apparently the fix isn't in b10 after all...
     
  38. Dirly

    Dirly

    Joined:
    Mar 24, 2013
    Posts:
    19
    dang... was going off what was said in the thread. Guess I'll keep on trucking till its patched.
     
  39. kexar66

    kexar66

    Joined:
    Feb 27, 2013
    Posts:
    48
    I thought it was this:
    • VR: Fixed an issue where vSync did not work with Cardboard/Daydream on Android. (871514)
     
  40. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    You're right, that's the fix, though it's strange that it's not listed in the "delta b9-b10" section (as it's not in b9 or before).

    Also, I can confirm that b10 fixes the jitter issue I had reported. Objects that move rapidly relative to the camera now appear to move smoothly, without frame drops. Great work!
     
  41. Dirly

    Dirly

    Joined:
    Mar 24, 2013
    Posts:
    19

    Don't suppose you could just post project Player Settings, Quality settings and Graphic settings... guessing I have something setup wrong.
     
  42. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    904
    Did this issue cause vsync to now always be enabled on Daydream? I'm still seeing a signficant FPS drop when moving from GVR tech preview to 5.6 beta 10. On GVR preview 13, we're between 50 and 70 frames per second, but on 5.6 we drop all the way down to 35 - 45 fps. I'm wondering if maybe vsync is being forced on in 5.6.
     
  43. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    AFAIK vsync should only drop the performance to 30 (from 60) if your game is unable to keep going at 60. So maybe the question is why you're not hitting a constant 60 on the GVR preview :)
     
  44. zleisure

    zleisure

    Joined:
    Oct 13, 2015
    Posts:
    4
    @joejo
    Still happening in Unity 5.6.0f2!When the head rotates, there will be jitter,did I have missed anything?
     
  45. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Have you profiled your app to see if there are any perf issues? Have you tried simplifying your seen to see at what point things get smooth again?
     
  46. zleisure

    zleisure

    Joined:
    Oct 13, 2015
    Posts:
    4
    @joejo
    Thank you for your reply!
    Sorry,Unity 5.6.0f3 is perfect!It’s OK,v sync count = Every V Blank!