**Unity Editor version : Unity 2022.3.21f1
ML2 OS version : Version 1.7.0 ; Android API Level 34
Unity SDK version : 2.2.0
Magic Leap SDK version: 1.9.0 or 2.2.0
Vuforia Engine AR version: 10.22.5 or 10.24.4
Host OS : Windows 10
I plan on making an application that utilizes real-time image tracking.To achieve this, I intend to utilize the "Vuforia Engine", which officially supports "Magic Leap 2".
For this reason, I downloaded the very-recently-released "Vuforia Magic Leap 2" sample available at the Unity asset store.
After making a few tests, I noticed the following: whenever I activate the Vuforia Engine, all AR content seems to jitter whenever I move the camera (i.e. my head); this does not happen if I stand still.
This has lead me to assume that one of two things happen:
- There is some component of the example scene(s) that make the camera move twice.
- In order to compensate for head movement, the Magic Leap hardware creates a frame which it renders along depending on my head movement, but does so in an exaggerated manner.
Thinking that it might be the fact that the "Magic Leap 2" device independently renders the content faster than the Vuforia Engine does, I also tried manually set the UnityEngine.Application.targetFrameRate
to 60FPS (and 120FPS), which is the recommended framerate provided by the Vuforia Engine --as a side note, the command VuforiaBehaviour.Instance.CameraDevice.GetRecommendedFPS()
returns 30
in my case-- and even attempted to mitigate the 120Hz refresh rate of "Magic Leap 2" 's AR display with the command QualitySettings.vSyncCount = 2;
.
One important thing to mention here is that I am not certain whether calling these commands has an effect. Judging from the pattern, may I assume that "Magic Leap 2" is treated as an Android device, thus QualitySettings.vSyncCount
is ignored (targetFrameRate and QualitySettings section)?
I should stress (again) that if I place some AR content in the scene with an inactive Vuforia Engine (by using the DelayedInitialization
option), then no jittering takes place. Once I activate it, the jittering starts. This happens even when there is no content that requires Vuforia anywhere in the scene.
In a nutshell, my question is:
- Why does jittering take place, even in the model scenes of the asset store (no changes whatsoever)?
- How can it be fixed?
Thanks to everyone who has taken the time to read this message.