8
$\begingroup$

I'm trying to have an object set as invisible that hides other objects, but only when they are behind it. I tried to use the object as a mask (by Compositing) but it works even if they are ahead it.

Thanks!

please note, I'm using the Blender Internal rendering engine

$\endgroup$
2
  • $\begingroup$ Actually the answer is already here - blender.stackexchange.com/questions/7613/…, so I think this is a duplicate $\endgroup$
    – Mr Zak
    Commented Jul 2, 2015 at 15:40
  • $\begingroup$ In Blender 2.8 use Holdout Shader........................................................................ $\endgroup$
    – gonnog
    Commented Sep 15, 2019 at 13:07

2 Answers 2

2
$\begingroup$

To make an object as a mask in Blender Render all you have to do is enable Transparency in the object material, change transparency mode to Mask and set Alpha to 0.

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks man! I'm feeling so stupid now I know that the solution was so simple. Just another tip I discovered on mask: If you want to have an object that works like a mask but also receives shadows, you don't have to enable Transparency but check the Shadow Only option in the Shadow tab. $\endgroup$
    – Fossa
    Commented Jul 6, 2015 at 16:55
7
$\begingroup$

One way this can be done, is using the render layers mask layers. While this may not be as simple as Denis's answer, it's always good to know more than one way to do something, and it can be a bit more flexible because it works with both cycles and BI (and should work with basically any other rendering engine also).

Using Mask Layers

To create a mask layer, move your object(s) to their own layer. Generally you want this layer to be a bit out of the way. I've highlighted in a few common choices, but of coarse, you can use whatever layer you want to.

enter image description here

Then, to use that layer as a mask, simply highlight it in the mask layers layer group.

enter image description here

This effect is really useful for a lot of things, including VFX, and advanced compositing, but my favorite use, is to make something appear bigger on the inside:

How can I create a portal?

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .