Reading: Eran Dinur, The Complete Guide to Photorealism for Visual Effects, Visualization and Games (Focal Press, 2022), Chapter 8, pages 87-93. This page is a guide to that chapter, not a substitute for it.
Why shadows get their own chapter
Dinur calls shadows the glue that holds elements together in a CG environment, a matte painting or a composite. Coherence falls apart when shadows are missing, mismatched or wrong - and shadows tend to get less attention than they deserve, because they are treated as a by-product of light rather than a subject.
His approach is to throw out the usual categories of shadow "type" and replace them with one idea.
Shadows are simply the relative lack of light
Most people picture a shadow as the sharp dark shape an object casts on a sunny day - a cast shadow. But photographers call overcast days shadow-less days, and that is not true either. You may not see your own shadow on the pavement under an overcast sky, but look under a parked car and there is a very distinct dark shadow. The same happens inside bushes, in tree canopies, at the base of rocks, between bricks, in cracks in the pavement - in any cavity, large or small.
Those get called ambient or occlusion shadows, but Dinur asks whether they are really different. On a clear day your shadow on the pavement is where most of the sunlight is blocked by your body. On an overcast day the shadow under the car is where most of the diffuse sky radiation is blocked. In both cases a shadow forms because a light source is partially occluded.
So: shadows are simply the relative lack of light. It makes no difference whether the occluded light came directly from a source or from a diffused version of it. The separation between "cast" and "ambient" shadows is artificial - there is no clear line, and in most lighting situations, especially man-made ones, the same environment holds shadows ranging from sharp to soft and dark to light.
He pushes it further. "Cast shadow" implies one object casting onto another, but shadows appear wherever light cannot fully reach, and that happens within a single object as much as between two. The shadow inside your nostrils is not cast by a separate object; neither is the shadow inside a half-open bag or a rock crevice.
The reframe worth keeping: from the light's point of view, everything - ground, trees, cars, people - is one single giant object, and any area of it partially or fully occluded from one or more sources is shadowed. Stop thinking of a scene as objects casting shadows on each other. Think of it as a unified entity in which the intensity, color and softness of shadows are set by the light sources and how they interact with the surfaces.
Shadow softness
Stand behind a wall in its shadow. If you cannot see the light source at all, you are in the umbra - the darkest part, where all the light from that source is occluded. Move sideways until part of the source becomes visible and you are in the penumbra, where only some of it is blocked.
The size of the source controls the transition. An infinitely small point source is either fully occluded or fully revealed, so there is no penumbra and the shadow is 100% sharp. But point lights exist only in CG. Every real emitter has size and shape, so every real shadow has at least a little softness. Larger sources make the changeover from full occlusion to full reveal more gradual, and the umbra-to-penumbra transition noticeably softer.
Source size is only one of four factors. Dinur's diagram sets out all of them:
- A - scale of the light source. Larger light, larger penumbra.
- B - angle of the light relative to the occluding and shadowed surfaces. At a straight angle the penumbra surrounds the shadow evenly. As the angle gets shallower, the penumbra stretches out in the direction opposite the light.
- C - distance between the occluding surface and the shadowed surface. Directly proportional: greater distance, larger penumbra.
- D - distance between the light source and the occluder. Inversely proportional: greater distance, smaller penumbra.
B and C together explain something you can check outdoors this afternoon: a tree's shadow is darkest and sharpest at the base of the trunk and softens as it goes, because the base is closest to the ground (factor C) while the canopy is furthest away. At sunset the shallow angle stretches the penumbra further (factor B), accentuating the softness.
Factor D is the confusing one, because you rarely see it work in isolation. Move a lamp further from an object and the shadow does get sharper - but the light also gets dimmer with distance, which reduces the shadow's intensity and largely cancels the effect visually. The one exception is the sun, the only source far enough away to sharpen shadows dramatically while remaining strong enough to cast visible ones at all. Sunlight shadows are sharp, though still modified by B, C and, most of all, the atmosphere.
Shadow color
Since a shadow is a relative lack of light, its color is the balance between the occluded and non-occluded light in the environment - the sum of all lights in the scene, minus the occluded ones.
On a clear sunny day your shadow on the pavement is slightly blue, because the warm sunlight is occluded and the shadowed area is left lit mostly by bluish diffuse sky radiation. Daylight shadow color is simple - only two components to consider. An urban night scene with multiple lights of different colors produces a far more complex balance.
The mistake this section exists to prevent
An occluded area is darker than a lit one, but it is not necessarily blacker.
The darkest shades in any environment are the most heavily occluded areas. Cracks in the pavement are already quite dark even in full sun, because they occlude both direct sunlight and much of the sky radiation. When your shadow falls across that pavement, the surrounding surface darkens - but those cracks keep the same black value, because no additional light is being removed from them.
So a shadow is darker than its surroundings and simultaneously has less contrast: the midtones come down while the blacks stay where they were.
Dinur names the consequence directly. Pushing the blacks too low while darkening to create a shadow is a common compositing and matte painting mistake, and he returns to it in Chapter 17.
His example photograph makes the finer point: on a sunny afternoon lit areas are warm and shadowed areas bluish-gray, but the exact color varies with texture and amount of occlusion - darker and cooler in the most occluded parts, brighter in more exposed parts, and warmer where the shadow blends with reflected light bouncing off nearby lit surfaces.
Overlapping shadows
When two shadows overlap, do they add up to something darker, or merge invisibly? It depends entirely on which lights are occluded.
- Same source - the shadows merge seamlessly. A group of trees on a sunny day all block the sun, so their occlusion forms one continuous shadow.
- Different sources - as in a room with two lamps, the overlap is where both are missing, so it is darker.
Nested shadows
Even when elements occluding the same source blend together, further occlusion can happen inside a shadow.
Dinur's build-up: a car parked in a tree's shadow adds no more direct sunlight occlusion, since that is already gone. But its floorboard sits much closer to the ground than the canopy does, so it occludes more of the diffuse sky radiation and creates a darker shadow within the tree's shadow. Put a small rock under the car and the proximity area between rock and ground is darker still - a third level of occlusion.
A typical evening living room, with several sources of different character and a lot of furniture, produces an intricate mosaic of overlapping and nested shadows at different intensities, sharpness levels and hues. That complexity is what a flat CG shadow fails to reproduce.
Contact shadows
Dinur opened the chapter by saying there are no separate types of shadow, so he explains why contact shadows still get their own section: not because they are different, but because they carry unique importance when blending CG with footage or combining 2D elements from different sources.
When two objects are close together, the area between them is occluded from most of the light and is strongly shadowed. This holds whether the scene is lit by a hard directional source or softly by diffused light - where surfaces touch, or nearly touch, the contact area is distinctly dark.
We are exceptionally sensitive to this, because we use contact shadows instinctively for spatial orientation - it is how you know where something is when you reach for it. Our eyes and minds are unforgiving about missing or mismatched contact shadows. Composite a CG table onto an image without generating the shadows where its feet meet the floor and the table appears to float.
He calls contact shadows the Achilles heel of digital art for exactly that reason, which is why 3D and 2D procedures for generating contact and proximity shadows get their own treatment later in the book.
His illustrating photograph is a good one: shot on a fully overcast day where he could not see his own shadow on the pavement, a pigeon and a leaf both generate clear shadows, because the bulk of their occluding bodies sits much closer to the surface.
Terms from this chapter
- Umbra - the part of a shadow where the source is completely occluded.
- Penumbra - the part where the source is only partly occluded. What softness is made of.
- Overlapping shadows - merge if the same source is blocked, darken if different sources are.
- Nested shadow - further occlusion occurring inside an existing shadow.
- Contact / proximity shadow - the dark area where surfaces touch or nearly touch. Critical to spatial reading.
Check yourself
- Give Dinur's one-line definition of a shadow.
- Why is an overcast day not a shadow-less day?
- Name the four factors affecting shadow softness, and say which one is inversely proportional.
- Why is a tree's shadow sharpest at the trunk?
- Why is a shadow darker than its surroundings but lower in contrast?
- Two lamps, two objects, overlapping shadows. When does the overlap go darker and when does it not?
- Why does a CG table with no contact shadow appear to float?
- What in your venue will cast a shadow you cannot fix in post?