Transparent Shadows

Not sure if that is the right title, but I was wondering if someone can explain to me, or point me to the right place. What i’m trying to do is render a scene that casts shadows but what id like to be able to do is render them transparent so when i save is as ARGB or transparent PNG the shadows would still show through. The reason is I want to be able to change the background in a Photoshop layer but it needs to still show the shadows from the scene. If i try to render it without a background then obviously there’s nothing to cast a shadow onto, so it doesn’t work. Hope all that makes sense, kind of hard to explain. Thanks in advance for any help you guys can give.

Don’t know if this is the right way to do it but messing around this is what I got.

I put the object (cube) and the object which has the shadow cast on (plane) on separate layers. For the floor layer I turned on Shadows on the layer settings so I could use it as a mask on the Compositor. And then with the Dilate/Erode node I used it as a factor to blend the two layers together with Alpha Over. You should play around with the settings to get a better result. I did this on the fly just to see if it could actually be done :stuck_out_tongue:

Oh, also on the layer settings for the shadows make sure you mask the first layer or else you’ll get some funky results XD

I hope this helps and you can sorta understand what I’m saying lol