Log in or register to post comments

Multi-target E.g. showing objects as if they were inside the box

December 13, 2012 - 1:41am #1

Hi. 

I saw the multi-target example showing a bowl rotating around a cereal box. It renders an object outside the box, over the image target on the surface of the box.

I'm curious whether it is possible to render objects as if they were inside the box. Is there a trick to achieve such an effect?

 

Multi-target E.g. showing objects as if they were inside the box

October 27, 2017 - 8:26am #11

Hi, Is there a way that allows the person walk inside the room (assuming the image target is on the wall, and the camera is inside the box) and so the user can see the object while inside the room. So this is a case that when the multi-target's surface is not on the outside but they are inside.  How could we generally achieve this? Thank you.

Different effect to different faces

December 19, 2012 - 3:44am #10

Hi Kang,

At present in Unity each shader applies to a material which applies to the object as a whole.

Probably the easiest way to accomplish this would be to break up the box into separate faces and have a specific shader applied to each face as it seems as though you want to achieve certain effects for certain faces.

The other option would be to customise the shader, though this may not give you what you are after if you want specific effects on specific faces.

N

 

Thank you. I've looked at the

December 17, 2012 - 1:38am #9

Thank you.

I've looked at the RenderOcclusionLayer shader code. 

I understand that the lines of code (o.Albedo = video.rgb; o.Alpha = mask.r; ) are related to the rendering of partially transparent surfaces of the flake box. 

Is it possible to apply the effect differently to the different faces? for example, no such an effect on the left and right faces. 

 

Yes the BlenderCube is being

December 16, 2012 - 6:32pm #8

Yes the BlenderCube is being drawn onto the box and this is being rendered using the RenderOcclusionLayer shader, which creates the transparency effect. This is the critical shader for understanding how to render for this effect. The others control rendering of the GridCube and Teapot. 

Try posting to our OpenGL forum for advice on how to customize the shaders - and you can use the ones we provide as a basis for customization. 

Another question

December 16, 2012 - 6:12pm #7

Thank you.

I roughtly understand that the sample works like this. It puts a cube that exactly fits the Flake box on the video background from camera, so the real box in the video stream isn't visible. Then, the teapot is put in the cube and translucent faces of the flake box is rendered over it. Is that right? 

It seems that the proper shader programming is critical. So does the Android sample. But I have very little knowledge of it. Can you give me some advices, where can I get help or resources about the shader? Are the shaders that I need to understand and modify RenderBoxBackface, RenderOcclusionLayer, RenderTeapot in the Shaders folder of Unity sample?

 

Another question

December 14, 2012 - 2:43am #6

"I have another question. Is this occlusion management feature available (or meaningful?) with multi-target examples?"

Well, given that the sample works with the same Multi-Target box, then answer is obviously yes :)

"Can I achieve similar effects using a box with a single image target on one surface, e.g., front face?"

I think this should be possible if you set up the right shader, and maybe apply some of the techniques to the Image Target sample.  The other thing you could try is simply using the OCM example but pointing it at an image of just the front of the Flakes Box - the teapot should still show.

Hopefully this will give you some ideas.

N

Another question

December 14, 2012 - 2:21am #5

Thanks.  I just tested following your feedback.

I have another question. Is this occlusion management feature available (or meaningful?) with multi-target examples?

Can I achieve similar effects using a box with a single image target on one surface, e.g., front face?

 

 

Box transparency

December 14, 2012 - 1:54am #4

Hi Kang,

Yes it should be possible by adjusting the shader.

If you click on the BlenderCube underneath the MultiTarget you can see the BoxSetUpShader script and below this in the inspector is the MaterialOcclusionLayer.

Essentially if you change the material then you can get different effects.  Initially it is set to Custom->RenderOcclusionLayer, but if you change it to say Unlit->Transparent then it will show you the insides of the box.

You may need to experiment a little to get the effect you want, but there is a plethora of information available at the Unity site about shaders which should help you.

HTH

N

Thank you for your reply. I

December 14, 2012 - 1:34am #3

Thank you for your reply.

I looked at the Occlusion Management sample and saw a teapot inside the box. In the sample, the surface of the box is translucent, so I can still see the surface. What I thought was that objects were shown inside the box without the surface of the box. 

Is it possible to adjust the transparency of the surface of the box?

 

Multi-target E.g. showing objects as if they were inside the box

December 13, 2012 - 2:40am #2

Hi Kang,

If you look at the Occlusion Management sample it does exactly this :)

It shows a teapot inside the box where the box has a transparent shader applied to it so you can see the teapot inside.

HTH

Log in or register to post comments