Log in or register to post comments

Background-texture-access on Droid Bionic

March 4, 2012 - 8:41pm #1

I'm a little new to Unity and Vuforia, and I'm having trouble getting access to the background texture provided in the new SDK.

I've created a GUITexture in my application, and in the ARCamera script, I've placed the following code in the Start function:


        QCARRenderer.Instance.DrawVideoBackground = false;
        
        DisplayTexture.texture = new Texture2D(0, 0, TextureFormat.RGB565, false);
        int nativeTextureID = DisplayTexture.texture.GetNativeTextureID();
        if (!QCARRenderer.Instance.SetVideoBackgroundTextureID(nativeTextureID))
        {
            Pic = "Failed to setVideoBackgroundTextureID " + nativeTextureID;
        }
        else
        {
            Pic = "Successfully setVideoBackgroundTextureID " + nativeTextureID;
        }

I get texture information, and a the set call is true, The texture just renders as black.

Am I missing something obvious here?

Re: Background-texture-access on Droid Bionic

March 22, 2012 - 12:30pm #6

Nevermind. I must have mucked something because reinstalling it and turning off the BackgroundCamera object worked ok now.

Re: Background-texture-access on Droid Bionic

March 22, 2012 - 12:17pm #5

I'm having the same problem, did you figure it out?

I'm new to vuforia, so please forgive my ignorance, but the Readme says "special shader". I don't want to make negative gray images. I just want plain normal images. Do I need a special shader for that? Or can I use Unlit or Diffuse? I only ask because I've had trouble with both.

Re: Background-texture-access on Droid Bionic

March 8, 2012 - 8:55am #4

I tried the demo and it seemed to work ok, so I must be doing something wrong!

Re: Background-texture-access on Droid Bionic

March 6, 2012 - 10:12pm #3

Honestly no, I have not tried that example completely as-is. I feel a bit silly realizing that.

I will try it tomorrow and report my results!

Re: Background-texture-access on Droid Bionic

March 6, 2012 - 6:51pm #2

Have you tried running the BackgroundTextureAccess sample as-is? The sample includes a Readme that shows how to render the camera image using the ARCamera (and without post-processing effects). I suggest looking at the VideoTextureBehaviour script that is included with the sample.

- Kim

Log in or register to post comments