Extracting shadows


This is my first post, so hello everyone :).

I’m rendering an image like this one: http://www.pasteall.org/pic/13087

I want to “extract” the shadow of the object, but keep the relative alpha. I’ve tried using renderlayers, but my shadow is completely black.

If I cannot use Blender to do this, maybe I can render my images with a completely white floor (like this example) and try to extract the shadow using Gimp’s “color to alpha”, but I wanted a cleaner method if possible.

Thanks in advance!


Thanks a lot for your help.

I don’t know if I understand you correctly, or maybe I didn’t expressed myself clearly (my fault :))

What I’m trying to do, using your example, is this:

Don’t know if you see it (doesn’t show in the post preview), but the floor has become transparent (maybe it’s white now because the page background), but the shadow continues to be there (this is a mockup using GIMP) so when I layer on top of another image, the shadow will still be visible. This is for a game I’m working on, and I want to extract the shadow with alpha blending, so it will be visible in any place.

Hope I made myself more clear, although your use of the composite window has helped me a lot! Thanks again!

Here is how I have done this in the past.

Remember, Blender is a baby and must be spoon fed.

This technique requires certain that objects be on certain layers.

The lights and camera are moved to layer #11
The floor remains on layer #1.
The cube gets moved to layer #2.

Two render layers are setup. #1 is the floor shadow layer. #2 is the cube, or object layer. Both of these RenderLayers include the lights and camera on layer #11.

In compositing, you must alpha the objects over top of the shadows.

When you render, you must remember to select all layers (use the tildae ~) for this to work.

NOTE: This works for limited shadow style operations. Shadows of objects falling on to other objects on layer #2 is not covered with this setup.


25_shadowPassWithEnvLight.blend (554 KB)

Thanks a lot!

This is exactly what I wanted! I have the exact setup you’ve proposed (different layers for different things) but I didn’t really get into the composition nodes until benu suggested it. Also, I don’t need any fancy shadowing onto other objects (at least for now), so extracting the floor shadow will be just enough.

Again, thank you both for your help :slight_smile: