Log in or register to post comments

Reticle disappears in VR mode

November 23, 2015 - 12:49am #1

I am finding that when in VR mode if I background the app and the reopen the reticle appears for a second then vanishes.  If I then gaze at my VRTriggers they activate correctly but no reticle is present.

I then find after this if I gaze at the AR trigger I get back to the AR mode then when I look at the trigger image the screen goes black.  If I look away from the trigger image the camera comes back on?

Reticle disappears in VR mode

November 23, 2015 - 12:01pm #6

OK thanks for the pointers, I will check this out and see what I can find and report back.

Reticle disappears in VR mode

November 23, 2015 - 11:52am #5

Is there some hidden code that when the app restarts in VR it resets the retuictle to factory start up position where it was in the sample (which I use as a base for my app?)

 

The code that handles the Reticle appearance is all in the Reticle.cs script;  the Reticle is attached (parented) to the ARCamera, so, as long as it holds its child-parent relationship with the ARCamera, its position and localScale should remain valid with respect to such parent.

However note that the Reticle is just a piece of sample application that was designed specifically for the sample, not meant to represent a general feature of Vuforia; as such it wasn't tested for the specific app use case that you describe in your app (i.e. parenting user head and Cardboard Main under a common game object).

So, for this specific case I would probably suggest checking for the possible reasons why the reticle may become invisible, i.e.:

  1. is the Reticle mesh renderer (for any reason) disabled after resuming the app? if so, what code might be disabling it ?
  2. is the Reticle still child of the ARCamera after resuming the backgrounded app ? 
  3. how are the Near clipping planes of the left and right eye cameras set after resume ? (maybe the reticle gets clipped by the near plane, e.g. if the near plane is set to a value which is greater than the reticle distance from the camera...)
  4. are the position and scale of the reticle unchanged, before and after resuming the app ?

Reticle disappears in VR mode

November 23, 2015 - 7:54am #4

Hi,

OK so have this to offer:

I have not modified any of the scripts for reticle, BlackMask or GazeRay.

I move the CarboardMain and UserHead objects to the position I require and then created an empty game object with a picot dead centre in my scene and set CardboardMain and UserHead to be childrean of it.

I then rotate the parent and this thus moves the CardboardMain and UserHead all as one. 

I can go into VR mode and see the reticle, go out to AR and see reticle, go back to back into VR and see the reticle and it always appears.

The only time it vanishes is when the app is backgrounded and then reopened?  If I then go back out to AR the reticle reappears.  

Is there some hidden code that when the app restarts in VR it resets the retuictle to factory start up position where it was in the sample (which I use as a base for my app?)

Including debug output in Reticle.cs in the if cam statement I get this

 

No to ... VuforiaBehaviour.Instance.SkewFrustum
Reticle:Update()
 
this.transform.localPosition = Vector3.forward * (cam.nearClipPlane + 0.5f)  results in -> (0.0, 0.0, 0.6)
Reticle:Update()
 
this.transform.localScale = new Vector3(0.01354849,  0.01354849, 1)
Reticle:Update()
 
And this output is the same when in VR and when I return from it being backgrounded?
 
 
 

 

 

 

Reticle disappears in VR mode

November 23, 2015 - 4:18am #3

OK Thanks, I will double check this and let you know, thanks ;-)

Reticle disappears in VR mode

November 23, 2015 - 3:55am #2

I;ve tried reprducing this with the ARVR sample, but I do not observe this behaviour if I run the AR-VR Vuforia sample 'as is'; 

 

a few hitns and tips:

- check the script that governs the Reticle logic (e.g. check if there are any code changes with respect to the one provided with the sample)

- check if the Near Clip plane of any camera might be set to a value that may clip the reticle (as the reticle is also rendered very close to the near plane)

- add some debug logs and check if the position and local Scale of the reticle has consistent values during the app (e.g. after a resume)

 

 

Log in or register to post comments