20
$\begingroup$

I need to render a model on a transparent background. The models have a light source so they should be casting a shadow on a surface (the XY plane). The purpose for this is to overlay the rendered images (out of blender) on an image of the actual surface, so I want to generate the render including a semi-transparent shadow.

I don´t have any problem rendering the models on transparent background, but I can not make a shadow appear. I tried adding a surface below the model so the shadow can fall on it, but now there's the problem of keeping the surface from rendering.

How can I render the shadow on a transparent background?

$\endgroup$
0
25
$\begingroup$

On the shadow catcher object, add a material and enable Shadows only in Material > Shadow:

enter image description here

This will make it so that only the shadows cast on the object are shown, the rest of the surface will be invisible, showing the sky behind it.

If you set the alpha to Transparent in Render settings > Shading, the sky will be rendered as image transparency.

enter image description here

$\endgroup$
7
  • $\begingroup$ Exactly what I was looking for! Many thanks :) $\endgroup$
    – ButterDog
    Aug 10 '14 at 22:43
  • 2
    $\begingroup$ @DavidSilvaSmith Make sure you have the render engine set to Blender Internal and that you have created a material $\endgroup$
    – gandalf3
    May 26 '15 at 9:44
  • 1
    $\begingroup$ Do you have a solution for how to do that in Cycles engine? I asked here blender.stackexchange.com/questions/47569/… $\endgroup$ Feb 29 '16 at 7:25
  • 1
    $\begingroup$ @fabriced There are numerous workarounds, but there is no true equivalent in cycles. Yet. It's currently being developed, and hopefully will be part of the 2.8x project $\endgroup$
    – gandalf3
    Feb 29 '16 at 9:26
  • 1
    $\begingroup$ Just a comment for people in 2021. There is now (2.93.x at least) an option in the "Object Properties" tab of the shadow catcher, under the "Visibility" section. The checkbox is called "Mask -> Shadow Catcher" and does exactly what was asked. The world background can be made transparent in "Render properties -> Film -> Transparent" $\endgroup$
    – beeb
    Nov 10 '21 at 15:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.