How to render matte objects?

Hy there,

How do you render an object1 with the matte of another obejct2 so object2 cuts away some parts from object1?

Here’s what I wanna do concretely. I have this shot (real):

And I insert some water:

When I render only the water, you can see the water behind the car, so how do I get rind of that part?


I need the water transparent and without the part behind the car for later compositing in AE.

Thanks in advance!!

Give your cutout object the “holdout” shader.

Alternately, if you need a color matte rather than an alpha matte for something like Nuke you can give your object an emissive color of 1 that is only visible to the camera

Ah very cool, thanks to you both, holdout shader does exactly what I want.
BUT now the scene got quite dark and no reflection is visible on the water. I tried it with a mix node, but looks like holdout can just be used alone.
How can I achieve the same effect as the holdout shader does but with no light loss and with reflections of the walls in the water?

Ah, try this:


(substitute that diffuse shader for whatever setup you have already)

That way, you get the holdout when viewed directly, but when other rays bounce onto the object they get the regular mat.

Thanks J_the_Ninja, you’re my hero! :wink: