Can an object block other geometry but be invisible in the render?

Hi- new to Blender. I’m doing a quick architectural viz of new windows on an existing house.
I’ve done the windows and perspective matched cameras to existing photographs. Dependent on angles, some parts of the window frames are masked by the existing building fabric. I can achieve this by recreating the walls in blender with the window frames correctly set back from the front surfaces.

Is there some way to get these walls to block the parts of the window frame visually but for them not to appear in the render? Then I can render over the existing photograph to show the new window in place.

I know I could composite an edited version of the background image over the render but just wondered if there was a way to avoid those steps.

While posting this, a similar topic was highlighted in which the answer was to set one of the material “options” to “sky” but I don’t see this setting in 2.8

This was the topic Invisible Objects that block Visible Objects

Hi, welcome to Blender!

For a Cycles render you can use a holdout shader for the blocking wall parts. You have to set the background to transparent for it to work (Properties ‣ Render ‣ Film ‣ Transparent), so you still have to have two renderlayers and composite your window over the photograph, but it’s better than manual editing.

See here: holdout shader

(The manual isn’t completely ready for Blender 2.80 yet, so if things don’t make sense, just ask.)

Edit: fix link

2 Likes

Brilliant- that’s exactly what I was looking for!

Thanks.

You’re welcome, glad it helps. :slight_smile: