Log in or register to post comments

Cannot alter camera position without flicker

August 25, 2018 - 11:04am #1

I used to use a script on my AR Camera that would smooth the motion in the MonoBehaviour.LateUpdate method. In earlier versions this worked great, but in the latest version it seems Vuforia sometimes (but not always) sets the camera position back afterwards.

using UnityEngine;

[RequireComponent(typeof(Camera))]
public class CameraAdjustment : MonoBehaviour
{
	Camera Camera;

	private void Start()
	{
		Camera = GetComponent();
	}

	private void LateUpdate()
	{
		int seconds = Mathf.FloorToInt(Time.time);
		if (seconds % 2 == 1)
			Camera.transform.Rotate(new Vector3(20, 0, 0));
	}
}

This simple script will try to alter the camera's rotation for one second every two seconds. If you run this on a phone (Android in my case) it is smooth for one second when not trying to alter the rotation, and then for the next second it will flicker between the angle Vuforia set and the new rotated angle.

How can I stop this flickering? As it stands I cannot add my own smoothing technique due to this flicker.

I have attached a full example Unity project.

Thanks

AttachmentSize
Package icon New Unity Project (5).zip3.68 MB

Cannot alter camera position without flicker

September 26, 2018 - 2:11pm #8

This is dependent on what the World Center Mode is set to. You can modify this on the Vuforia Behaviour.

Thanks,

Vuforia Engine Support

Cannot alter camera position without flicker

September 26, 2018 - 10:43am #7

It looks like the Vuforia approach has changed. Previously the camera moved and rotated, now it seems it is the ImageTarget that moves and rotates.

Cannot alter camera position without flicker

September 10, 2018 - 4:26pm #6

I'm unclear what you're trying to do with this script. The camera is controlled by Vuforia and the device's camera. I deployed your project to a Galaxy S9 and saw no difference in the camera feed compared to a different project without your camera code. I did not see any flicker either.

Could you please share which devices you are seeing this flicker on and some videos of both the issue and the desired behaviour?

Thanks,

Vuforia Engine Support

Cannot alter camera position without flicker

September 10, 2018 - 12:08pm #5

Wow, is this really how poor Vuforia support is? This is terrible!

Cannot alter camera position without flicker

September 2, 2018 - 4:04am #4

Thanks for your reply

My current version is 7.2.24

Track Device Pose is off. If I enable rotational tracking it crashes on my phone, if I enable positional tracking the FPS drops from 20 to 10.

I don't recall the previous version, it would have been the default installed with Unity 2017.3 or 2017.4 (I think both worked).

I can't afford a frame rate drop to 10FPS, it looks awful. That's why I am implementing my own smoothing, but in the new version this just isn't possible.

 

I really need to solve this problem as I am close to release (and therefore close to purchasing a licence), and as I need to run on older phones I cannot afford the performance hit. I worked quite hard on my previous smoothing solution and it worked very well, but now suddenly Vuforia seems to be fighting me for camera rotation+position despite me changing it in the late stage of LateUpdate or PreRender

Cannot alter camera position without flicker

August 29, 2018 - 11:05am #3

Hello mrpmorris,

What version of Vuforia are you using currently and what version were you using in the past that didn't encounter this issue? Are you using the positional device tracker in your current project?

Thanks,

Vuforia Engine Support

Cannot alter camera position without flicker

August 29, 2018 - 10:29am #2

I'm looking to buy a licence if I can solve this problem. Am I likely to get some help?

Log in or register to post comments