4
$\begingroup$

I somehow do not get it, and various other answers somehow do not help me here.

I have a cube and a plane.

The plane acts as a "Shadow Catcher" and that works fine so far.

When I render the scene, the cube with its shadow is output to me as a semi-transparent image:

enter image description here

However, when I render the layer with the Shadow Catcher as its own image for further processing in the image editor, Blender does create the shadow of the Shadow Catcher for me, but not on a transparent background but always on a white surface.

What I tried:

  • I have chosen "Cycles" as renderer.
  • I have activated the option "Transparent" in Render Properties > Film.
  • I have activated the option "Shadow Catcher" in Object Properties > Visibility.
  • I have selected the output "Shadow Catcher" in the Compositing Nodes.

enter image description here

I need the output of the Shadow Catcher on a semi-transparent background, without workaround and fiddling around, exactly as it is output in the image.

What am I missing here?

$\endgroup$
5
  • 2
    $\begingroup$ Maybe related: blender.stackexchange.com/q/245413 $\endgroup$ Commented Aug 5, 2022 at 14:26
  • $\begingroup$ @JachymMichal It's honestly not the optimal solution for the problem, but rather a workaround that achieves relatively uncertain results and also involves a lot of trial and error. So for me it's currently a possibility, but I'd be happy if someone still has a solid answer without Compositing Nodes for it. Thanks anyway! $\endgroup$
    – quellenform
    Commented Aug 5, 2022 at 15:09
  • $\begingroup$ I've been doing it this way for years. Not with everything, but when Blender cannot. It's crude, basic, and simple enough to produce shadows, transparent and otherwise without resorting to nodes, compositing etc. I only placed this suggestion because you've specifically mentioned in your last comment that you were seeking something solid & without Nodes. Hoping it solves your problem... Link - blender.stackexchange.com/questions/518/… $\endgroup$
    – Edgel3D
    Commented Aug 9, 2022 at 23:44
  • $\begingroup$ It's looks like that it is impossible to replace multiply operation with alpha compositing if the shadow is not completely black. $\endgroup$
    – Crantisz
    Commented Aug 11, 2022 at 7:40
  • $\begingroup$ @quellenform The proper way to store shadow catcher data is OpenEXR Multilayer file format (PNG can't handle all data needed for later successful compositing - appearing on a new bg). Also current state of SC (even with some new implemented features) doesn't cover all passes for proper composite devtalk.blender.org/t/lets-finally-fix-the-shadowcatcher/691 $\endgroup$
    – vklidu
    Commented Aug 15, 2022 at 13:26

1 Answer 1

4
+50
$\begingroup$

The issue here is not "shadow" part, but indirect light (or any emissive source) data (in your case blue tint in shadow).

Natively this kind of data are stored in shadow catcher pass uncropped, so these pixels can be still composed as a "light" pixels. They are not visible on transparent bg, but since there is any bg they can be properly interpreted (react with bg pixels).

enter image description here

You can store uncropped data in OpenEXR format to continue in other image editor (if supports emissive data). See also how to composite shadow catcher properly.

If you still want transparent shadow catcher,
you can try to use Separate Color node in YUV color space...

  • use Y (luminance) channel as Factor for Alpha Over

enter image description here

  • use U and V channels to separate color of indirect light

enter image description here

Mix as follows ...

enter image description here enter image description here

Mix it with bg in blender looks identical, mixing in Ph seems to be way darker for some reason ... maybe also shadow is not just a "black", but as already mentioned - mixing semi-transparent PNG with bg in post-process is something that never will be mixed correctly ... not only because of indirect light generated by object, but since there is not a bg, there is not a way to affect current object by bg's indirect color, etc.

Edit

If you are asking Why Shadow Catcher (SC) pass doesn't output transparency ... I'm just guessing - It just follows standards of any other pass. Any of them doesn't using alpha info, all passes are mixed by some blend type (multiply, screen, etc.). From this point of view it works as supposed to.

So if you are looking for a way to adjust shadow (and indirect light) casted on plane (that is set as SC) in separate layer, than I see two options.

  • One way is to render object ID pass so you can later use it as a mask in other apps (and you don't have to render twice as render layers). Or use any other masking options.

  • Second way is to use similar technique mentioned above ... just Y (luminance) is used to be a factor for Set Alpha node.

enter image description here

Saved Render as PNG ... enter image description here

Render (without SC pass enabled) enter image description here

Render with SC pass (enabled) run through node-tree above. enter image description here

So yes it is some fiddling around with compositor, but for the reasons I described before Edit.

$\endgroup$
6
  • $\begingroup$ I've been wondering about how it works for some time, nice explanation :) $\endgroup$ Commented Aug 14, 2022 at 12:54
  • $\begingroup$ @JachymMichal I just hope I'm right :) $\endgroup$
    – vklidu
    Commented Aug 15, 2022 at 13:27
  • $\begingroup$ OK, this is very informative, but unfortunately not the solution I am looking for. The semi-transparency is calculated correctly in the image and a transparent surface is used as background. However, when I use Shadow Catcher separated, this layer is always on a white background and I don't understand why Blender does that. The information is there, but from my point of view it is not output correctly. $\endgroup$
    – quellenform
    Commented Aug 15, 2022 at 17:44
  • $\begingroup$ Or have I completely misunderstood something and you have the solution packaged here anyway? I would need the semi-transparent layer with the shadow as a separate layer in Photoshop/Affinity to change the intensity of the shadow afterwards and crop the image to the essential area (For use on the web). $\endgroup$
    – quellenform
    Commented Aug 15, 2022 at 17:44
  • $\begingroup$ Thank you! I will try it out like this. It currently looks like the best solution. $\endgroup$
    – quellenform
    Commented Aug 16, 2022 at 16:22

You must log in to answer this question.

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