Shadows from Alpha in Blender
This is not a "Beginner's guide" to Blender. The goal in this usage example is to laod a PNG
file with alpha channel and have this image cast a shadow that corresponds to the outline of its opaque regions. The instructions here assume
— for an earlier version see here.
-
Remove the default cube: in edit mode with the cube selected, press x→"All"
-
Add two planes, one large and one small, offset from each other similar to this picture:
Select the top plane (here it is called Plane.001).
-
While in object mode, go to the materials button,
-
Add a new material:
-
The default name is
Material.001
, and we want to preview it as a "Flat XY plane":
-
We don't actually want this material to show up (except where allowed by the texture to be added soon), so we check the "Transparency" box here:
You can enable either "Z Transparency" or "Raytrace" here.
-
For this material, we now set the texture:
-
After clicking "New" here, we specify in the
texture type
popup menu that the texture will be loaded from an image:
-
Now an "Open" button appears, which lets us navigate to the image file.
The image in this example is called bowtransp.png
; to find out more about the science behind it, take a look at this page.
-
Click "Show Alpha" to reveal the transparent regions in the Preview:
-
Below the image file name information, the "Influence" panel appears.
-
Here, we can choose a
Blend
mode, e.g., "Multiply" or "Darken":
This mode will determine how the PNG
image is combined with the color of the upper plane material on which it is placed. In "Mix" mode, for example, the alpha channel of the PNG
does not make the parent material transparent (its default base color was opaque white, but it now appears black), so the shadow will not have the desired shape. For the example below, I chose "Darken."
-
Now we're done with the upper plane.
In the 3D view, select the larger plane on which the shadow is supposed to fall, and give it a new material in the materials panel (here Material.002
):
Add desired properties, such as a diffuse color (see the Preview above).
-
For this
Material.002
, under the "Shadow" item, click the checkboxes to enable receiving transparent shadows:
-
Now we're ready to render:
Jens Nöckel
Last modified: Tue Dec 21 17:43:57 PST 2010