Professional photographers often use shadow mask 'gels' with their lights, to duplicate in the studio the effects of light that is being patterned by something in the environment, but which is out of the picture, such as sunlight that is coming through a Venetian blind, or filtering through the branches of trees overhead. In this tutorial I will demonstrate a method for creating your own 'shadow mask gels' for use in DAZ Studio, which you can use to create a dappled sunlight effect, like sunlight filtering through a leafy canopy above the subject. The DAZ Studio rendered images in this tutorial have no post-work, other than to crop and scale them.
Compare the two pictures below.
The image on the left is nice, but the background implies she's sitting in a densely wooded area, while the light shining on her looks like she's in an open clearing. Adding the shadow mask creates a more realistic effect, like she's actually under a canopy of tree branches.
Adobe Photoshop 4 or higher (or any similar 2D graphics application)
A digital camera (or a regular camera or suitable picture, and some way to scan the photograph)
Any flat prop
A picture of tree branches:
Finished shadow mask:
Free OBJ file for a large planar object:
You have a scene in DAZ Studio like the one above, and you want to add the effect that there are leafy branches overhead, between the subject and the sun.
Examine the scene. The background environment shows broad-leafed trees, with fairly dense branches and leaves. It's apparently a sunny day, with the sun high in the sky. Looking at the tree trunks behind her, the sunlight is coming in at a fairly steep angle from the left. The scene's 'distant' lighting for the figure has been set to match that, with a less bright 'fill' spotlight from the right, to keep the shadows on the girl from being too dark.
Keep this environment in mind when taking or selecting the photograph to use for your shadow mask. Your picture should be of a similar environment. I went into my back yard and shot several pictures with a digital camera, looking up through tree branches at a similar angle, behind which was a clear blue sky. I chose a sunny, cloudless day, so it would be easier to make the mask. Here's a half-sized image of the picture we'll be working with. (You can download the full-sized image from the my references links.)
We want a uniform amount of light to come through where there are no branches. So we will use Photoshop to select all the blue sky, and delete it.
Open the image in Photoshop. Use the 'Eyedropper' tool to select a part of the sky that is about the mid-point of the shades of blue in the picture.
From the Select menu, choose 'Color Range'. Set the “Fuzziness” setting as high as necessary to select most of the sky areas. Click on OK to select the sky.
With the sky selected, you can simply press the delete key, and the area selected will turn white.
Depending on the software you use, the selected sky area may turn to transparent instead of white. This does not matter. The object is to get the sky area a uniform white color, and if it's transparent, it will become white when you save it to JPG later in this process.
Press Ctrl+D (windows) or CMD-D (Mac), or chose 'None' from the Select menu, to de-select the current selected area.
We don't need the color information, since we're just creating shadows with this image.
On the Image menu, select 'Mode', and choose 'Grayscale'. Click on OK to discard the color information.
I preferred to use this grayscale image for my shadow mask. It seems to make a 'softer', more natural shadow. For a harsher shadow, go to the Image menu again, select 'Mode', and choose 'Bitmap'. Choose a 50% threshold, and click on OK to discard the grayscale information as well. You may want to save both versions, and experiment with which you like best.
We will be using this mask to create a transparency map. Right now, the image shows white where the sky is. Transparency maps are black for transparent areas, and white for opacity. We need to turn this image into a photographic negative to do that.
Photoshop has a simple tool for this. On the Image menu, select 'Adjust', and choose 'Invert'. The image is now like a negative, and looks like this:
Save this file as a JPG image (I used the name TreeMaskJPG for the file), and quit Photoshop. (You can download this full-sized image from the my references links.)
Open your scene in DAZ Studio. For my example, it's a single Distant Light that will be casting the shadows of the leaves and branches that are above the figure. We want to interpose a plane between that light source and the figure, which is transmapped to allow light through only where there are no leaves or branches.
Select a planar object and add it to your scene. Any flat object will do. If you don't have something suitable, I created a planar object that's large and already a suitable distance above the floor plane for most scenes. You may download it for free, at http://www.polyhedrongroup.com/tutorials/dap-shadows/Canopy.obj . Since this is just a very simple OBJ file, you'll need to use DAZ Studio's 'Import' command to add it to your scene. It creates an object called 'Canopy', with one surface material zone, called 'default'.
In the Surfaces palette, select surface of the 'Canopy' object, or whatever planar object you will use for your mask.
Set the Diffuse color=Black, 100%.
Set the Opacity 100%, with your ' TreeMaskJPG' file that you just created as the transparency map. (There's a small triangle next to the opacity setting, for selecting the map to use.)
If the object has a specularity, ambient, reflection or refraction value, set them all to black, 0%.
You should now have a partially transparent planar object in your scene.
Position the planar shadow mask between your light source and the subject, so its shadow falls where you want it. You may need to adjust the size and position to get it to look right. I've found it is usually best to position the plane just above the visible area of your scene. If you select the light source as your viewport image, you can check to make sure the mask is in the right place. Unfortunately, DAZ Studio won't let you move objects in your scene from a viewport that is displaying what a light is pointing at.
One easy way to adjust the position is to set a camera (other than your main camera) at the same angles and rotation as the light source, so the camera is pointed at the subject, with a line of sight parallel to the light source's rays. Then you can use that to adjust the plane's position.
Make sure your light source and the plane for your shadow mask are both set to cast shadows. I found that for my light source, a shadow softness value of 0.5, and a shadow bias of 5 to 7, worked well for leaf shadows.
Render your image. It should look something like the sample below. You will almost certainly have to adjust the size and position of the mask to get a good effect, and to get the shadows to fall where you want them. But with a little practice, you should be adding realistic shadows in no time.
Happy rendering! I hope you found this information useful.