Log in or register to post comments

Occlusion Sample for Unity?

July 23, 2012 - 2:38am #1

Hi there!

I am sorry for the stupid question, but is there also an Occlusion Management sample for Unity? Because i found some threads in this section about Occlusion Management but not the sample itself. I am having all the current versions of unity and the vuforia sdk.

I really want to achieve the "blending" effect but i don't know where to start.

Any advice?

thanks in advance

Occlusion Sample for Unity?

August 30, 2012 - 12:06pm #18

Something to be aware of, is that tablet cameras tend to have a long focal length, which creates the appearance of image magnification.

Occlusion Sample for Unity?

August 30, 2012 - 11:41am #17

We are testing the APK that you'd sent.

So currently you are seeing this behavior w/ you app on the Transformer, Prime and also a scale magnification on the Acer A500.

You may be correct regarding the resolution reporting, but we need to determine why this would differ between  your app and our samples

Thanks for the follow-up.

Occlusion Sample for Unity?

August 30, 2012 - 2:46am #16

I post this in this thread, because i think its problems root from the same source:

It seems to me that some devices, especially tablets, don't adjust the videobackground correctly. As I mentioned in this thread before the Asus Prime has a kind of negative zoom, but now I encountered that also other tablets have problems too. I tested the Acer A500 and this one seems to zoom the videobackground with a factor of something like 1.25-1.5 . This time I only used the standard ARCamera and nothing else, so there should be no error from my side. 

So maybe there is a bug in the projection of the videobackground, or some Android devices are just not giving back the resolution of the camera like other devices (just a guess of me).

Maybe one of the Qualcomm teammembers can give some feedback what the source of this problem could be.

 

regards, GrannySmith

Occlusion Sample for Unity?

August 7, 2012 - 11:32pm #15

It's completely the same. I couldn't find any difference in setup.

Occlusion Sample for Unity?

August 2, 2012 - 7:07am #14

Thanks. Is there any difference between how you've set-up your scene, w/ regards to the camera and background plane, and the sample or are they essentially the same?

Occlusion Sample for Unity?

August 1, 2012 - 2:49am #13

This is the output:

V/NvOmxCamera(  114): disableMsgType => 0x10

 

I/Unity   (13915): VideoTextureInfo 1024 512 764 432

 

I/Unity   (13915): UnityEngine.Debug:Internal_Log(Int32, String, Object)

 

I/Unity   (13915): UnityEngine.Debug:Log(Object)

 

I/Unity   (13915): VideoTextureBehaviour:Update() (at X:\valentin.klammer\AR-Motors-Unity\trunk\Assets\Scripts\VideoTextureBehaviour.cs:91)

 

I/Unity   (13915):  

 

I/Unity   (13915): (Filename: X Line: 0)

 

I/Unity   (13915): 

 

V/NvOmxCamera(  114): enableMsgType => 0x10

 

I/Unity   (13915): Screen Width x Height = 1280 x 752

 

I/Unity   (13915): UnityEngine.Debug:Internal_Log(Int32, String, Object)

 

I/Unity   (13915): UnityEngine.Debug:Log(Object)

 

I/Unity   (13915): VideoTextureBehaviour:PositionVideoMesh() (at X:\valentin.klammer\AR-Motors-Unity\trunk\Assets\Scripts\VideoTextureBehaviour.cs:240)

 

I/Unity   (13915): VideoTextureBehaviour:Update() (at X:\valentin.klammer\AR-Motors-Unity\trunk\Assets\Scripts\VideoTextureBehaviour.cs:104)

 

I/Unity   (13915):  

 

I/Unity   (13915): (Filename: X Line: 0)

 

I/Unity   (13915): 

 

 

Besides this, the first part from VideTextureInfo and the following four outputs get repeated all the time, whereas the " Screen Width x Height " Is only displayed once

Occlusion Sample for Unity?

July 30, 2012 - 10:39am #12

Thanks for the follow-up. It does appear that the video background texture isn't being scaled properly. Can you send me a log of your build & run session from the Transformer? And please add this log statement to line 204 in VideoTextureBehaviour.cs ..

Debug.Log("Screen Width x Height = "+ mScreenWidth +" x "+ mScreenHeight );

another helpful log is at line 82 ..

Debug.Log("VideoTextureInfo " + texInfo.textureSize.x + " " +
                    texInfo.textureSize.y + " " + texInfo.imageSize.x + " " + texInfo.imageSize.y);

 

You can filter for "Unity" in LogCat to remove unnecessary log entries.

Occlusion Sample for Unity?

July 30, 2012 - 7:43am #11

The sample works fine on the Asus Transformer.

In the screenshot you can see my hierarchy and the inspectors of the plane (child of the Backgroundcamera) and the AR Occlusion camera if that's of any interest:

http://img840.imageshack.us/img840/4724/hierarchyinspector.png

 

EDIT: I tested it now also on an ACER A500 tablet. It works fine there too, though i noticed that the camera has a zoom ( something like x1.25 zoom; vague guess). So maybe the plane with the cameratexture is stretched bigger than the actual display size. But again, this is just a guess and i can't say it for sure. But at least the tracking works properly and there is no margin (or the plain blue background) visible , so a layperson won't notice it. But you know how it is, you want do the things right, right?

Occlusion Sample for Unity?

July 27, 2012 - 11:15am #10

Can you post a screengrab of your expanded project heirarchy, so that I can see how this is structured. Also have you tested the Occlusion Management sample on the Transformer Prime?

Occlusion Sample for Unity?

July 27, 2012 - 2:43am #9

Nexus S: working fine

Asus Transformer Prime T201: not working properly; see screenshot below

http://img696.imageshack.us/img696/9948/screenshot2012072710283.jpg

Just tested it on an Galaxy Nexus and it works fine on it too. The Asus still makes problems.

Occlusion Sample for Unity?

July 26, 2012 - 3:00pm #8

Hello,

Can you tell me what model your device is? You can find this is Settings -> About Tablet .

Thank you,

-Peter

Occlusion Sample for Unity?

July 25, 2012 - 5:25am #7

Thanks for that so far. I've got a problem with the video background: On my phone (Nexus S) everything works perfectly fine, but on an Asus Prime Transformer Tablet i see a blue margin around the videotexture (which must be the standard background from unity). I looked inside the code of VideoTextureBehaviour and for me it seems that it's setting the size of the plane dynamically to the screens size, though this doesn't happen on the tablet. Additionally the 3d models behave very strangely and are not tied correctly to the trackables.

Any ideas what might cause these problems?

 

thanks in advance

Occlusion Sample for Unity?

July 24, 2012 - 10:38am #6

That second camera is being used to render the video background onto a mesh that's generated by the Video Texture Behaviour, which also controls the scaling and positioning of the mesh at the camera's far clip plane.

Occlusion Sample for Unity?

July 24, 2012 - 8:14am #5

The only available documentation here is in the SDK docs under special options right at the end:

https://ar.qualcomm.at/sdk/ios

The Occlusion Management sample app illustrates how shaders can be used to make objects appear semi-transparent. Pointing your camera at the FlakesBox target allows you see the teapot object inside the partially transparent looking box.

This sample is based on four shaders, one per object to be rendered in correct order (the video background, the checkerboard-box, the teapot inside and the occlusion box). To specify the call order, each shader is associated with a priority (using Tags in the shader definition). For example, inRenderTeapot.shader, the tag is Tags {"Queue"="overlay+3" "RenderType"="overlay"}.

The Vuforia-OcclusionManagement sample gives you more details. You can use the four shaders as a starting point. You can also visit the Unity website to learn more about the shader ordering in Unity

HTH

N

 

Occlusion Sample for Unity

July 24, 2012 - 7:35am #4

I was playing with the Occlusion Management Sample and to be honest i don't really understand how this works. For example why there are two cameras and why there is the VideoTexture involved. I want to achieve the same effect in my Application using a more complex mesh (a car to be specific) but this doesn't work at all.

 

Is there any documentation on how this all works, or someone willing to explain it to me? This would be really helpful.

thanks in advance

Occlusion Sample for Unity?

July 23, 2012 - 5:00am #3

Thanks for the fast response.

I just made everything fresh from the start and now the sample is there. I wanted to integrate the Occlusion sample in an existing Project and maybe the project on the SVN didn't have the last update of the Vuforia Unity Extension.

 

Sorry for the inconvenience

Occlusion Sample for Unity?

July 23, 2012 - 4:19am #2

Hi grannysmith

Yes there is an occlusion sample for Unity which should be in this package:

vuforia-occlusionmanagement-ios-1-5-9.unitypackage

N

 

Log in or register to post comments