Shadow Catcher



I want to integrate the cars into the background image. The problem is that the houses cast a shadow onto them until they reach the corner. So the lighting changes. When i composite the shadowpass, i have the shadows of the standin geometry for the houses(cubes)also showing up in the pass and making the background image darker. I couldn’t figure out a way to get a shadowpass with only the shadows of the cars. Is there a way to have the cubes only cast a shadow on the cars or something like that. I tried all sorts of combinations in the visibility. Nothing works. Same for the ambient occlusion pass. They show up in that too.

I think you can also set up the Shadow Catcher in the building.

Hi, thank you for the quick response, but i don’t understand. Where is the difference in the nodes ? If i try this it doesn’t work.

There is no node difference.

safs.blend (1.4 MB)

The shadow of the building does not affect the floor, but there is a problem that there is no shadow in that area. :sweat_smile:

Ah ok. Like halfway there :grin:
This confuses me so much. Maybe shadowlinking works somehow. I can’t believe nobody else had that problem.

Take advantage of ViewLayer.
I can’t find a proper video lecture to solve the problem.

The problematic shadows can also be separated into each layer, rendered, and then synthesized and controlled.

add…

I think the node is a little wrong. :thinking: :sweat_smile:
Alpha Over must follow the Mix node.

adada.blend (1.4 MB)

The image used View Layer.
Suzanne has the shadow of the building, and only Suzanne has the shadow

Thanks so much ! More rendertime, but at least it works. I was hoping to get it using shader setups and visibility settings, but that doesn’t seem to be possible.

1 Like

The shadow disappearing like that is intended behavior: the idea is that the object exists already in the footage (it can be helpful to think of the Shadow Catcher button as an “is this thing present in the original scene” toggle—e.g. lights with it turned on will cast shadows, but no light, since their light is assumed to already exist in the scene and only needs to be occluded by the objects you’re adding, while lights with it turned off will illuminate the base footage, since you’ve now told Blender that this thing you’re adding has no analogue in the plate).

So when you activate Shadow Catcher on an object, it receives shadows, sure, but it will also no longer cast shadows onto other Shadow Catchers—since all Shadow Catcher objects are assumed to already exist in the footage, the shadows they cast on one another already exist as well, and you don’t want to double those up with new shadows.

Shadow Catcher turned off for the screen-right pillar:



Shadow Catcher turned on for the the screen-right pillar—the shadows that already exist are punched out, so only the new shadow areas are added:

The problem with that, of course, is that your shadows need to line up perfectly with the original scene, or you’ll get artifacts at boundaries: they’re already visible in this one, even with a very close lineup:


and even a tiny rotation of the sun angle makes it much more apparent:

You have a couple options there: either keep tweaking the shadow casters more and more precisely to try to match things up exactly, or address it in compositing. If you render the shadows whole, without the shape punched out of them, you could try to extract the footage shadows, maybe with a luma key, and punch that out instead (so the shape cut out of the shadows is the exact shape of the underlying shadows, instead of the 3D approximation from Blender). Or you could use something like the “all-shadow-pass” workflow demonstrated here, where you create a second image representing the whole scene if it were in shadow, and then use your shadow pass to mask it in.

2 Likes

Thank you for thus elaborate answer. Finally i understand, how it is intended to be used. Man i just slapped it onto plane thinking, thats enough.


Now i am back :wink:
Shadows fine, after finally understanding it. Now i want to fake some reflections. As you can see the plane is only visible to glossy rays, all fine. BUT, why is it showing up in the shadowpass ?

Ok, i think i know. Since it has a emission shader, it’s of course contributing to the shadow pass. I found turning it into a shadowcatcher solves it.
It would be really nice to be able to exclude objects from contributing to the ambient occlusion and shadowpass.

I think this video will be helpful. :thinking:

1 Like

Hey again. Thank you that video is gold !
Renderpasses are kind of a nightmare and blenders system is really not ideal. It should have material and visibility overrides like maya. Anyways thanks for the help ! That is a neat way to do it.

1 Like

These are support issues for the render engine, so the solution in the blender may be different.

I don’t know exactly how, but it may require a little complicated process compared to other commercial software. :sweat_smile:

I haven’t worked with maya for over 10 years, so i don’t know what it’s now like. It used to be crap too, but it was more straight forward. In blender it seems to be not really uniform logic. I know they work on that and there is only so much they can do at a time with all the subjects they deal with. Good thing is there seems to be always someone who found a way to do it :slight_smile:
What should be really added is overrides for viewlayer. Like materials, world, rendersettings so you can use evee for some stuff. With that everything would be less nervwracking.
Materialoverrides are actually possible with duplicating collections. I didn’t know that, but thanks to your video suggestion i know that now.

1 Like