Scanline camera stretching issue

March 16, 2015 - 7:30am #1

Hi, I'm hoping someone has a solution to this. I am migrating my project from a device database to cloud reco with Vuforia 4.0 and Unity 4.6.3. I have it pretty much working but am having a problem with the scanline (which, like many, I wish I could just do away with). When it is visible onscreen it is causing my UI elements to stretch (see attached on left). As soon as the target is recognized the UI returns to normal (on right). I saw this post with what seems to be a fix relating to this but it isn't correcting the issue for me. I've added the script and attached to to the Camera object under the ARCamera as instructed. What am I missing?

 

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/vuforia-40-and-unity-50

 

Thanks!

AttachmentSize
Image icon Scanline_Error.jpg183.14 KB

Scanline camera stretching issue

March 23, 2015 - 6:40am #12

You're welcome

Scanline camera stretching issue

March 23, 2015 - 6:39am #11

Yes, that resolved the issue! Thank you very much for your time.

Scanline camera stretching issue

March 23, 2015 - 5:50am #10

Hi,

after trying out your setup, I've successfully tested this workaround;

just add the following simple script to your GUITexture objects:

using UnityEngine;
using System.Collections;

public class NoStretch : MonoBehaviour {
	
	void OnRenderObject()
	{
		GL.Viewport(new Rect(0,0,Screen.width,Screen.height));
	}
}

 

This solved for me (using the Cloud Reco sample with a GUITexture).

 

Scanline camera stretching issue

March 20, 2015 - 9:51am #9

Got it from your PM, thanks.

Scanline camera stretching issue

March 20, 2015 - 9:14am #8

I've just built a minimal project based on the Cloud Reco sample. I am seeing the same issue when scanning. What's the best way to get the project to you? Dropbox?

 

Built in Unity 4.6.3

Xcode 6.2

Vuforia 4.0

AttachmentSize
Image icon IMG_1158.jpg252.7 KB

Scanline camera stretching issue

March 19, 2015 - 2:33am #7

Could you provide a minimal repro-case setup to reproduce this ?

For example, starting from the Cloud Reco sample, would a single guiTexture element be sufficient to reproduce this ? 

any additional details would help..

 

Scanline camera stretching issue

March 18, 2015 - 6:12am #6

Sure. I am building the UI with guiTexture and scaling based on screen size and placing with Vector3.

Scanline camera stretching issue

March 18, 2015 - 3:38am #5

Could you describe your setup a bit more in depth ?

are you drawing your GUI with the OnGUI() method of MonoBehaviour ? or are you using the Unity 4.6 UI system ? 

 

Scanline camera stretching issue

March 17, 2015 - 11:19am #4

Thanks for the reply and suggestion, Alessandro. Unfortunately, adding the GL.InvalidateState(); call did not fix the issue on the iPad Air 2. Do you have any other suggestions? This is a big issue for me.

Scanline camera stretching issue

March 17, 2015 - 7:35am #3

Hi, the fix in the thread https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/vuforia-40-and-unity-50 refers to Unity 5,   not Unity 4.6

 

One quick thing you could try is to add this call right after the line GL.IssuePluginEvent(-1);:

GL.InvalidateState();

and see if it makes a difference.

 

 

Scanline camera stretching issue

March 16, 2015 - 11:30am #2

Update: The above fix seems to be working on a iPhone 6 Plus, but not on an iPad Air 2.

Topic locked