Is there a way to make a transp material that will turn object behind it invisible?

so for example, i have this magic transparent wall, and this cube floats into screen, and you can see it, but as soon as it goes behind the wall, it becomes invisible, but the background scene doesn’t.

How would I do this? I can’t work on my project till I have an answer.

Thanks in advance!

I don’t think there’s going to be an easy answer on that question.
Instead of looking at materials, you’re going to have to take a look into compositing.

You’ll probably end up masking that cube away from the moment it goes behind your magic screen.

In Blender internal what you’re looking for is called z-mask.

Quick tutorial:

You got the default scene, the cube on layer 1
Make a plane on layer 2 between camera and cube somewhere, obfuscating a part of the cube.

In the Renderpanel go to the layers.
Make a second renderlayer (+)

In the first renderlayer select layer 1+2 under scene as those are the complete scene layers.
Under Layer only select the first layer, holding the cube.
Leave mask layer blank.

For the second renderlayer select layer 1+2 under scene again.
Under layer only select hte second layer holding the plane.
And under Mask Layers, select the second layer as well.

Now the renderscene consists of layer 1+2
On the first renderlayer there is only the cube, camera and light
On the second renderlayer there is the plane and it is marked as mask.

If you render now, everything behind the mask object is invisible.

never really used this Z mask feature before

tried to follow your recipe but did not work
are the layers done like this


but it didi not work for render !

thanks

Because you did it wrong, I´ll be more careful to seperate RenderLayer and SceneLayer in the re-explaination:
I only see 1 SceneLayer, you need to have 2.

There’s actually even a simpler way with only 1 RenderLayer:

Defaultscene, cube, lamp, camera on SceneLayer1
Create Plane to obfuscate the cube and move it to SceneLayer2 (with the m.key)

For the RenderLayer under “scene” activate SceneLayer1 with the default scene and SceneLayer2 with the plane on it.
Under “layer” only activate SceneLayer1 with the default scene in it.
Under “Mask Layers” activate only SceneLayer2 with the plane.

If you render now, Blender renders SceneLayer1+2 and uses Layer2 as mask layer.

I tend to put z-mask objects on seperate renderlayers for compositing reasons.

Any way you could post pics of the setup?

EDIT: Never mind, found it out, thanks!

my only remaining question would be if I could be able to hide some objects, but not others?

i’ ll try new set up later on

but i tough you where talking about the Z depth thing use with Composite i think!
use to make like a cross section on objects in scene !

but still an interesting effect !

thanks

sorry could not redo it
either way

would be nice to see the 2 ways of doing
it might be usefull in futur !

here is the file can you correct it and upload again

znasklayer261.blend (79.5 KB)

thanks
happy 2.6