Tutorials

Quick View Other Tutorials   

Adjusting Depth-Mapped Shadows for Best Results

For Poser versions 4 through 7, including Pro Pack

Poser's depth-mapped shadows allow realistic, soft shadows in most situations- but certain scenes can cause problems due to the way in which the shadow maps are generated. Here's how to fix the odd shadow-map problem!Poser uses several different kinds of lights to illuminate its scenes- spotlights, infinite lights, point lights and ambient image-based (IBL) lights. Spot and infinite lights can cast either depth-mapped shadows or ray-traced shadows. There are advantages and disadvantages to both types of shadow; typically ray-tracing adds considerably to the render time of the scene, and ray-traced shadows tend to be quite sharp, at least when used with default settings. Increasing the softness of ray-traced shadows adds even more to the render time, so for most scenes depth-mapped shadows are preferable. Note- point lights by their nature only cast ray-traced shadows.

In some circumstances, however, using depth-mapped shadows can produce odd results due to the way in which Poser sets up the shadow maps. This can manifest as shadows not showing up properly, or having strange, jagged edges; it can almost always be fixed with just a little adjustment to the lights and cameras.

For a concrete example of how this works, let's take the following scene.

Here we have James with his hand by his face, standing next to a prop, with a convenient surface placed nearby to catch shadows. Rendered using the main and face cameras using default settings it looks like this-

This is fine so far; the shadow maps are doing just what they ought to. Now let's introduce a little complication- if we scale the box prop up along the Y-axis (making it taller), we'll change the settings for the shadow mapping- as the box gets taller and the shadow map gets recalculated to fit the tall box, the amount of shadow map that's used for James gets smaller and smaller, even though the cameras used to render the images haven't changed.

The shadow maps are computed using a special set of cameras- for each light that casts a shadow, there's a Shadow Light Cam associated with it, that is used to determine where to place the shadows for that light. The best way to explain this is to visualize the scene in this way-

The key factor here is that the shadow camera zooms out as the overall scene gets bigger- which means that, given a 256x256 pixel shadow map, that each individual part of the scene gets less and less shadow detail, resulting in this kind of effect-

These are face camera and main camera renders of James, with the box prop (which is offscreen for the face-cam) resized to 5000% along the Y axis. To give an idea of how scaling that box prop changes the shadowing, take a look at the scene as the shadow light cameras see it-

The problem is obvious. There are a couple of solutions. If we have a lot of computing resources and need to render animations, or to render a number of different areas in the scene, we can increase the shadow map size for each light to give more detail; this will make the render take longer and use more memory. We can also use ray-traced shadows- these are unaffected by scene dimensions, and while they do take longer to calculate they can give a good look, as shown here-

- but if we're just rendering a still image there's another way that adds no render time and gives good results while still using depth mapped shadows. The trick here is to zoom the shadow light camera in, so that the shadow map covers the scene elements that we're actually going to render but nothing else. After zooming in, here's what the shadow cameras should see-

- and here's what the rendered output looks like.

If you're interested in the technical underpinnings of depth-mapped shadows, some useful articles can be found

For an informative look at how Maya (for example) handles the same issues, see .