Let's (finally) fix the ShadowCatcher

I was revisiting the “what’s new” webpage for 2.83-2.79 and I discovered we didn’t even have a shadow catcher until 2.79, not sure if that’s good, I mean it was worked not too much ago, but at the same time it wasn’t seen as important until very recently.

Not enough funding or Devs before 2.80

3 Likes

Are there any updates on this topic that dev team can share? Much appreciated.

3 Likes

Also commenting to show interest. I have been coming back to this page daily for a long long time!

I am with you on this one @psychoboy852!

@brecht, do you have any comments on this? I remember you posting comments back on this in 2018 and 2019 with some ideas, but this issue seems to have fallen to the wayside.

Is there any updates? Has there been any devs assigned to fix this? It’s been years and years since this has been brought up as an issue/bug (June 2018), and this is one of the biggest differences between Blender and the other DCCs. To not have a working shadow-catcher leaves Blender (Cycles) almost useless for compositing when comparing with the other DCCs that have working shadow-catchers… 2 years with a known bug that breaks compositing capabilities seems like a massive show-stopper for the devs? Either way, was just hoping for an update because it’s been 2 years since this issue was raised.

You guys have absolutely killed it on the Blender releases. When 2.8 came out I legitimately jumped into the air with happiness. Eevee, UDIM, Mantaflow, Adaptive Subdivision, etc… With every release you guys are changing the game. Every release has been an absolute treat, and I know that as software users it’s important not to get militant or have too high of expectations of the developers because you all have so dang much on your plate!

However, I agree with all of those posters above. I am disappointed that this isn’t a development priority when it’s one of the most basic functions of every other DCC and is a part of every software that has to work with pre-rendered + filmed video.

To clarify, LuxCoreRender has a working shadow-catcher, and it is legitimately a renderer in Blender. Doesn’t this work as a POC (Proof of Concept) to show that Blender can have a working shadow-catcher? Shouldn’t this give Blender devs an idea of how to tackle this?

We’ve all waited 2 years, so I’m not saying I can’t wait another 2 years. I can easily wait another 2 years. Blender is beyond worth the wait! But, I am concerned. I mean, this will be tackled at some point right? I would hate to come back 2 years from now and still have a broken shadow-catcher so I just wanted to second what Psychoboy said and respectfully ask for an update to the handling of this bug.

14 Likes

Maybe this could be a nice Idea for a GSoC Project?

7 Likes

I’ve needed an accurate shadow catcher for almost every project I’ve worked on. I’ve just decided that I have to sacrifice some level of realism when working in blender, and I wish that wasn’t the case. There’s been almost nothing about this from the dev’s side in years, and this is something that blender absolutely needs to make it a viable option for visual effects artists or anyone working with live-action footage. Also, it seems that there is a huge number of people that agree as this topic has gotten a massive amount of attention, which is awesome to see that so many people care!

@brecht Has there been anything done or has this been talked about since this topic was created?

13 Likes

Hi, lack of possibility to create accurate shadow and reflection pass really surprised me, I thought this is long time managed and now my project got stuck with no solution to be seen.

@brecht I pledge for more attention to this issue (reflection and shadow catcher)

4 Likes

I am just here to remind you your “Never ever going to happen” quote. Just 3 years have passed and UE4 is becoming mainstream visualization tool with all the raytracing tech while at the same time ChaosGroup has released their realtime Vantage visualization tool. So exactly as I predicted - both games and offline renderers are approaching the same point of convergence from two opposite directions :slight_smile:

3 Likes

Why was this flagged? I am the creator of this thread. I talked with Troy about the convergence of offline and realtime graphics. It’s not in any way inflammatory, and it’s related to the general topic of rendering. Since I created the thread I should have at least a bit of say in what’s offtopic and what is not.

Yes, his response is not very understandable, nor appropriate, especially given that what I stated is the truth, but at the very least my response should not have been flagged and hidden, because there is absolutely nothing in it that goes against the rules of this forum, unless they are exercised in extremely subjective manner.

I want a simple, clear explanation of what is wrong about post, which describes a change in the rendering world towards realtime workflows in past 3 years, in a thread I myself have created, which talks about rendering related feature.

It is an important discussion to have, because whether the rendering workflow is realtime or not greatly affects ho important are certain aspects of shadow catcher implementation, mainly considering compositing workflow. Some of those can be a features which would be difficult to implement, and probably at the same time not really that important any more given the rendering speed which can be achieved these days.

6 Likes

+1 for the proposed shadow catcher.

1 Like

The built in shadow catcher is a bit lightweight, especially for HDRI illumination and video overlays. I’ve stopped using it except for scenes with simple illumination.
I’ve been applying something like the process described in the first post for a few years now as a hobbyist (see my deviantart gallery) and I have made it work reasonably well. Good results can be achieved by generating the “alpha as RGB” information by comparing render passes with and without the shadow catcher and the foreground objects. Several view layers/render passes and a bit of maths in the compositor is needed (there’s a bit more detail in my post below). It’s not perfect but I’ve taken it far enough to keep me happy and I’ve stopped polishing the process.
Is it straightforward - NO! Is it fast to render - about twice as long as a straight scene.
So yes, needs an update. I think it’s more a matter of adding another render pass or two and a compositor node to mangle the passes back together, a bit like how the denoisers work. No need to attack the way the basic shaders work or alter data structures.

I think the future is looking bright for the ShadowCatcher in Cycles since the announcement of Cycles X.

Check the Looking forward section on this page: https://code.blender.org/2021/04/cycles-x/

" Shadow catchers: we’ll try a different algorithm that can take into account indirect light "

4 Likes

Work on the shadow catcher for Cycles-X is underway. It can be found here: https://developer.blender.org/D11172

Edit: The change has been committed to the Cycle-X branch: https://developer.blender.org/rBc77529091f8d658f7bf5590d136a2c19c3c02559

7 Likes

The differential is closed now and looks to be amazing already!

1 Like

Having a go with the new cycles X shadow catcher and I was hoping to use it for reflections too. After trying with a simple test, it looks like it makes the value of the reflected model too high in the Shadow Catcher pass, over 30 in some channels in this test. Then when multiplied with a background plate makes that get too bright:

The shadow catcher pass should only be multiplied over the scene the shadow catcher object is designed to replicate.
For example, in the scenario you’ve shown above with the cube being placed into the classroom, your shadow catcher should replicate the classroom in both geometry and general materials (materials being an important part) otherwise it doesn’t work properly and you get the results you’re seeing now.

This is because Cycles calculates what values it should output to the shadow catcher pass based on differences between the shadow catcher lit up by CG replicas of real world lights and the CG objects in the scene. If there is a huge disparity between the shadow catcher lit by the CG replicas of real world lights and your real life footage, then the results it produces will appear incorrect.
Because your shadow catcher is a plane with a simple reflective material on it and “real life footage” is a complex classroom scene, there is a huge disparity between these two and as a result you end up with wildly incorrect results.


High values like 30 show up because of the fact you’re multiplying your shadow catcher over your “real life footage”. Your footage may contain dark table and you want a bright object to be reflected in it. Because your footage is originally dark you might have a pixel value like 0.03. To get it to appear bright when reflecting the object, you need to multiple that value by a large number. So multiplying 0.03 by 30 gives you a pixel value of 0.9, a result closer to what you’d expect if a bright object was actually in your scene being reflected in the table. Different channels will have different values because the shadow catcher also catches colour information and as such needs to multiply different channels by different values to get the correct colour after compositing.

1 Like

Thanks for the in depth reply! That does make sense as to why it would do it in that way. I was actually testing it in a different scene which I can’t show here unfortunately. In the shot I have water with whatever background reflected in it already. I guess this is a more specialised use case but surely not uncommon but I would want where my cg object is reflected in the water to have that reflection be shown instead of the plate reflection.
I was accomplishing this before with a second render layer where my cg object was white emissive and then using the reflection in the water there as an alpha to composite. So it would be useful then perhaps for an alpha channel in the shadow matte where reflections of the sky/other shadow cathers are 0 alpha but normal objects are 1.

Just to make it clear, you have a video or image or whatever of the “real world” already that looks kind of like this:

You have some water and some objects are being reflected in the water.

What you want to do now is use the shadow catcher to add an object in that reflects in the water? Like the scene below?

The new shadow catcher should be able to do this. However, you need to match the shadow catchers geometry and materials closely to the objects in your “real life” footage otherwise you may end up with results like these (Notice the issues in the “water” of this scene):


Yep, exactly that. Currently it’s just multiplying and brightening the existing reflections. I was hoping to be able to use the shadow catcher in a situation like that without having to render separate masks with render layers.

That compositing is wrong:

The reflections should be solid and not allow the background to slip over the reflections, right now that shadow catcher is not working correctly.

I would say that reflections catched by the shadow catcher should be in a different render pass TBH.

This is the correct version (which AFAIK is the actual full scene):