Log in or register to post comments

Directional Light disabled after tracker visible/unvisible

November 22, 2011 - 3:59am #7

Hello,

I'm facing a curious problem with Unity and the Directional Light: I have a scene with 4 Image Targets that are simultaneously recognized.
Everything works fine, but if one of these trackers is lost/off-focus sometimes, the directional light (MainLight) of the complete scene is deactivated turning all other Imagetargets to a dark/grey color.
The luminosity of my scene also changes (grey to completely dark) over time. I can't figure out why... I'm testing on an iPad 2.
Following user describes the same issue:

http://unity3d.qatohost.com/questions/164462/objects-flickering-between-dark-and-light.html

My Hierarchy in Unity looks like this:

AR Camera
Directional Light
ImageTarget 1
-Cube
ImageTarget 2
-Cube
ImageTarget 3
-Cube
ImageTarget 4
-Cube

Is this a bug of the iPad 2, or how the Qualcomm internaly handles the scene in Unity ? The fact that all ImageTargets turns to grey/black after a while is really weird....
Thx a lot for your answers!

Re: Directional Light disabled after tracker visible/unvisible

November 23, 2011 - 5:25am #6

This is probably an artifact of how the tracker arranges the objects in the scene. Is your light bound to any of the trackables or the camera? If not, you might experience this drift, as the camera and trackable objects are moved in relation to each other over time, while the light stays stationary.

This is the purpose of the World Center Mode setting on the ARCamera:

AUTO:
The first trackable found is used to move the camera (i.e. the trackable stays still in the scene while the camera moves around it). All other trackables are then moved in relation to the camera.

USER:
Same as above, but you can select a single trackable to act as the world center, and it never moves in the scene.

NONE:
The camera never moves, instead all the trackables move around it.

With AUTO, the trackables will drift in world space over time as they are lost and found in different combinations. With USER one of your trackables will be the world center and will be anchored in world space. With NONE the trackables will all move around a fixed camera. In your case I might suggest using USER, especially if one of your trackables is the predominate one.

You could also play around with parenting the light to the trackables, reparenting to a visible trackable whenever necessary...

- Kim

Re: Directional Light disabled after tracker visible/unvisible

November 24, 2011 - 12:37pm #5

Hello Kim,

thanks a lot for your help, I've now changed the parameter to NONE (although USER also worked) and it works like a charm :-)
Just a small tech question: if my scene contains let's say over 10 trackers,
will there be any potential performance issues by using the World Center to NONE or USER instead of AUTO (e.g. takes a little bit more time to find the initial tracker and compute the position of all others) ?

Re: Directional Light disabled after tracker visible/unvisible

November 27, 2011 - 3:54pm #4

No, there shouldn't be a performance difference between the different world center modes.

- Kim

Re: Directional Light disabled after tracker visible/unvisible

March 27, 2012 - 4:13am #3

Hi

When i am putting my option to "none" or "user" it will automatically go back to "auto" after i make a build.

Even after pressing play button in Unity editor my AR camera setting goes back to "auto".

Am i missing something here?

Re: Directional Light disabled after tracker visible/unvisible

March 27, 2012 - 7:36am #2

Are you using Unity 3.5?

If so, that's a known issue, please see..

http://ar.qualcomm.at/node/2001747

You'll need to add..

if (GUI.changed)
{
// Let Unity know that there is new data for serialization.
EditorUtility.SetDirty(tb);
}

to OnInspectorGUI in TrackerEditor.cs

Re: Directional Light disabled after tracker visible/unvisible

March 28, 2012 - 12:14am #1

Thanks.

Issue solved.

Log in or register to post comments