Define and adjust your light sources

The workflow below is just one method of setting up a studio light scene using three lights. It is important to do several test renders, making only one or two adjustments between renders. This way you can keep track of your changes - it's difficult to determine what does or doesn't work if you've made a dozen changes to your lighting between renders.

Set the color and intensity of the primary light.

In my scene, I know that there will be additional lights, so I make this one slightly less intense than what "feels" right. I have made the color slightly yellow, which will give me warm specular and diffuse highlights. In this example, I used an intensity of 100 with a quadratic decay for a natural look.

Set the cone angle and dropoff

I generally set the cone angle to be larger than I want, then "back it off" by using a fairly large dropoff value. In this example I use a cone angle of 65 degrees and a dropoff value of 20.

Tweak the dropoff using the penumbra

The edge of the light circle can be further tweaked by adding a penumbra. In my example below, I used a penumbra value of -10 to give a soft edge to my light.

 
 
Shadows

The lights here are starting to look pretty good, but the objects are not anchored to the ground very well. I'll accomplish this using Depth Map shadows. Depth Map shadows are "fake" shadows, darkening pixels on surfaces where rays of light are blocked by other surfaces. An explanation of the attributes will help in adjusting the depth map shadows to have the look and feel we want.

 
 

Depth Maps

A depth map is an invisible square grid placed in front of a light source. When a ray of light passes through the grid, a series of measurements is taken. Consider the illustration below:

 

 

The depth map grid is "projected" onto the scene, dividing it into sections. Each pixel of the depth map corresponds to one section of the scene. When a ray of light passes through a pixel on the depth map, the segments of the light are compared to one another; in the above illustration, if line segment AB (determined by the first intersecting surface) is less than segment AC (determined by a subsequent intersecting surface) then Maya will place point C in shadow. This is done by darkening the corresponding pixel on the depth map, which is then applied to the surface during rendering.

Dmap Resolution

The Dmap Resolution, then, is critical to the quality of the shadow. In the following illustration, the Dmap Resolution is 128, which is too small. The shadow is pixelated at the edges, because too large an area of the scene is represented by one pixel of the depth map.

 
 

Dmap Filter

This problem can be corrected by either of two methods, or by both together. We can either increase the Dmap Filter size, which blurs the shadow, or we can increase the resolution of the map itself.

 
 

Both of the solutions are expensive in terms of render time, however. Although the Dmap Filter range is from 1-20, it's generally not a good idea to go above 8 or 10. These settings will substantially increase render times without yielding a great improvement in shadow quality. The same holds true for the Dmap Resolution. Higher values are costly.

One way to optimize the resolution for Depth Maps is to set the Dmap Auto Focus to "on", which is the default setting. This narrows the field of view used to compute the shadows, based on the area in view of the light source. Using this setting can cause artifacts if the area in view of the light changes over time; these artifacts can be seen as changes in the softness of the shadows or in aliasing of the shadow edges.

Self-Shadowing; Dmap Bias and MidDist Dmap

The image below has a completely different problem.

 
 

Notice the "Moire" pattern, or banding on the surfaces. This is also called "self shadowing", where the object is actually casting shadoww onto itself. To understand how this happens, consider a closeup of the depth map diagram we used earlier.

 
 

If we look at a closeup of a bitmap image, we can see the staircasing of the surface that we don't see in the final render. Although the distances are minute, clearly AB is less than AC, so point C would have to be in shadow.

This problem can almost always be solved by using the Mid Dist Dmap, which averages out small distances like this, and eliminates the banding problem. There are also problems inherent with self shadowing and motion blur which can be handled by using the Mid Dist Dmap.

Another solution would be to increase the Dmap Bias value. Increasing this value has the effect of "pulling" all shaded points (all the "C's", that is) toward the light slightly to effectively cause their distance calculation to be incorrect, hence taking them out of shadow. The default setting for Dmap Bias is .001, I usually incrementally increase this by a factor of ten until I've gone too far, then I back off by half. Start with .01, then .1, then back off to .05, and so forth.

If this setting is too high, your shadows will be inaccurate, however - looking like they've "pulled away" from the geometry casting them.

 

< back