Character layer casts shadows to world layer

I’ve been thinking about how some people like to composite short films in layers to save on rendertime. For example, they would render out a layer with all of the characters on it and then a layer with the rest of the world in it.

The problem is that there would be no shadows cast from the characters onto the world layer, as there is nothing in its layer that the shadows could hit. Is there any way to get around this?

Yes. 2D compositing within the 3D environment but this can be frustrating to set up sometimes because Blender doesn’t always work as advertized in some areas until you change something then change it back to what it should be. I would send these files to the bug tracker if the behavior were predictable or repeatable but it isn’t.

This is very similar to working with 3D layers in Adobe After Effects. Add a plane and map the image you wish to cast shadows and enable the shadeless button if it already has correct lighting. In the texture buttons select Use Alpha and in the material buttons enable Z Trans and set the alpha slider to zero then on the map to tab enable Alpha. Add another plane behind the first and map the background image to it. Enable Tra Shadow on the shaders tab for this plane in order to receive shadows that are in the shape of the first image’s alpha channel rather than in the shape of the plane which is casting the shadow. Add any lamp type that supports ray traced shadows and place it so that the first plane casts shadows on the background plane making sure that ray traced shadows are enabled for the lamp. If you have any trouble with the foreground elements still trying to cast a square shadow in the shape of the plane rather than in the shape of the alpha channel then change the lamp type to some other type then change it back. Remember that Hemi lamps DO NOT cast shadows. Good luck.