HUD Overlay Flickering

Hi Leapers,

I have attached an Interface inside the ML Camera Object Prefab and thought ist would render totally perfect. If I move my head there is a little lag, offset and flickering what Looks like the Camera object rotation is set to the last rendered frame, not the cuttend rotation? How can I attachean object to the Camera view, so it‘s totally 100% stable in front of you each rendered frame?

@pepone the jittering that you are experiencing is due the time-warp processing that occurs on the headset to make sure 3d content appears stable. Although it improves the stability of content placed in the world, content may appear to jitter if it’s parented to the user’s head. To reduces this, developers can do the following:

  1. If your application relies on content that is rigidly parented to the headset, you can disable time-warp processing by enabling headlock mode inside Magic Leap’s XR settings in you Project Settings.
  2. You can use a script to position the content in instead of rigidly parenting the content to the user’s headset.

Thanks. Still insecure, when and where to grab the data. So the tracked pose driver push itself in location/rotaion before render. So how do I grab it's rotation/ position that millisecond and manually place my GUI there?

You might be able to use the camera transform and position the object in the Update() loop. Since that loop is called separately.

Nope. No success so far. I would have to get the position and rotation of the camera at PreRender(), correct?

At this time Magic Leap 2 does not support dynamically adjusting the Time Warp settings. If head locked content is required, you can enable the head locked setting in the Magic Leap XR Settings . Enabling this feature will disable Time Warp for your application which will cause HUD elements to be smooth but world locked content to jitter.

Here is a script that positions an object in front of the camera and sets the Magic Leap Camera's StereoConvergencePoint to improve stabilization. However, some graphic artifacts are expected due Time Warp.

using UnityEngine;
using UnityEngine.XR.MagicLeap;

public class FollowHeadPose : MonoBehaviour
{
    private MagicLeapCamera _magicLeapCamera;

    void Awake()
    {
        _magicLeapCamera = FindObjectOfType<MagicLeapCamera>();
        if (_magicLeapCamera)
        {
            _magicLeapCamera.StereoConvergencePoint = transform;
        }
    }

    void Update()
    {
        UpdatePositionRotation();
    }

    void OnPreRender()
    {
        UpdatePositionRotation();
    }

    void UpdatePositionRotation()
    {
        transform.position = Camera.main.transform.position + Camera.main.transform.forward * 1;
        transform.LookAt(Camera.main.transform);
    }
}

Thanks for the script - but it's still lagging as you mentioned. If you see a solution on the SDK side (a camera should be able to render something fixed after it did all the ML stabilization(?)) - perhaps implement it there for a future release.

I will pass your feedback along to our voice of customer team