Log in or register to post comments

Hide virtual object behind real object

March 18, 2015 - 11:27am #1

Hey guys,

 

first of all: the Vuforia-Plugin is great!

I work with unity.

I try to use the object recognition. It works well, but there are 2 open questions for me.

1. i want to rotate 3 cubes around the recognized object. Is it possible to hide the cubes when they are behind the recognized object? Like in real life. If anything is behind any other thing, you can not see it

 

2. Everytime when i import my models into unity and attach one of them to an ObjectTarget, the object does not appear in the Scene. So how do i know the real size of it? there is only a grey plane with blue borders above. I am struggeling with the correct position of my cubes and other gameobjects in relation to the recognized object

 

 

Iam sorry for the english :/

Thanks,

Benjamin Wolf

 

Hide virtual object behind real object

March 19, 2015 - 11:01am #5

EDIT: all is working now. I do not know what i did wrong but now it works like a charm!

 

 

Hey,

thanks again for your help. I was able to use it in my project but now the cube that has applied the shader is not invisible. he is dark grey with a bit transparency.

 

Is this right? Or do I also have to change other things?

Hide virtual object behind real object

March 19, 2015 - 1:58am #4

That is not a part of the vuforia. Just google it for z-mask shader. import the shader into unity and apply on 3d model.

Just create a shader from project tab and edit the code as below :

Shader "Custom/ZMask" {


	Properties {
	}


	SubShader {
		LOD 100
		Tags { "Queue"="Geometry-50" "IgnoreProjector"="True" "RenderType"="Opaque" }
		 Pass {
			ColorMask 0
		}
	}
}
 

 

Hide virtual object behind real object

March 19, 2015 - 1:42am #3

vamshi wrote:

Yes you can hide the cube when goes behind the recognized object using the zmask shader. Create a model exactly same as recognized object and apply the zmask shader to that object (occlusion Concept) and place exactly at the recognized object position. it hides the cubes. 

Try Once !!! All the best !!!

 

 

Nice to hear that there is a way to realize it. But could you please tell me in detail how to apply a zmask-shader? Iam very new to Unity. Do i have to download it or is it a part of unity? Or maybe a part of the Vuforia Plugin?

 

thank you very much :)

Hide virtual object behind real object

March 18, 2015 - 11:42pm #2

Yes you can hide the cube when goes behind the recognized object using the zmask shader. Create a model exactly same as recognized object and apply the zmask shader to that object (occlusion Concept) and place exactly at the recognized object position. it hides the cubes. 

Try Once !!! All the best !!!

 

Log in or register to post comments