Log in or register to post comments

adding DepthMask to 3D model

May 30, 2013 - 3:08pm #1

I added a DepthMask  material to a plane and cube and saw that it was able to "pass through" video over any AR rendered images, which is what I wanted. But when I did this for a complex 3d model (imported fbx), my 3D object drew on the screen like normal, just as a video pass-through mask. Are there limitations to what DepthMask can be applied to? 

I want to show cutaways of 3D objects, and have a 3D mask on the parts that aren't AR so that will block the rendered parts when in front of them.

I'm using Unity 4.1.2

Apologies if this has already been covered, I read several entries about Depth masking, but they involved putting the mask object under ARCamera, but I need it under the target I believe. I'm also not sure if this is more of a Unity question.

adding DepthMask to 3D model

June 3, 2013 - 4:10am #3

The nearest we have to a tutorial is the Occlusion sample that uses the DepthMasking material to show the inside of the box.

I did run through more detailed steps to build a more basic sample in this thread:

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/depth-masking-unity

...though I guess you probably have already read this.

 

N

adding DepthMask to 3D model

May 31, 2013 - 3:09pm #2

My problem was that I was trying to add a material to a model object, rather than a mesh renderer. I didn't realize I had to expand the object in my Hierarchy view and then apply the material to the sub-meshes, rather than trying to apply it to the whole object. Just a Unity issue. 

It would be nice to have a tutorial explaining how / when to use the DepthMask material. thanks!

Log in or register to post comments