Illustration by Leo Espinosa

During one scene in the animated movie Shrek 2, scheduled for release next month, a valiant knight in full armor crosses a fiery moat, throws open an oak door, and enters the vast antechamber of a castle. With a quick flip of the hand he pulls off his helmet to reveal a mane of golden hair. Then, filmed in luxurious slow motion, the knight flips his do back like a medieval Breck Girl, and the flaxen strands shimmer in the light.

It’s not only a great sight gag but also an amazing technical breakthrough. In recent years moviegoers and video-game players have grown accustomed to seeing digital buildings, cars, and stage sets that are indistinguishable from images of the real things—the ones built out of atoms, not just digital bits. Yet a few frontiers remain. Computers can simulate objects created by natural processes, but even an untrained human eye will usually detect them as forgeries. Clouds, fire, trees, human skin—all these natural forms confound the algorithms of software. As does hair.




“We learned more about hairstyling than perhaps we wanted to know,” reports Ken Bielenberg, the visual-effects supervisor for both Shrek movies. “It’s relatively easy to model, say, a telephone, which is a hard, solid object. But with something like hair that’s made up of 10,000 or 20,000 strands—it’s hard to manage that on the computer.”

Computer modeling begins with two primary elements: the geometric shape of the object and the way light bounces off it. Animators typically define the shape of an object by creating digitized wire frames and then adding information about surface textures. Does the object absorb light evenly, or does it scatter it in specific ways? Turning that raw data into photo-realistic images involves a process in which a computer calculates the trajectories of millions of individual photons of light, then determines how those trajectories would find their way back to the pupils of an imagined viewer.

Ten years ago this type of modeling—called ray tracing—was possible only on a supercomputer. Now ray-traced images that are highly sophisticated, if not quite photo-realistic, can be created on a $200 Xbox video-game console. Nonetheless, ray tracing runs into difficulties with objects that do unpredictable things with light. Imagine the way light interacts with a shiny plastic ball, compared with its appearance on a rumpled velvet blanket. The blanket’s overall shape is more complex, of course, and to render the velvety texture you have to account for light bouncing off thousands of tiny fibers.

To capture the subtleties of human and animal hair for Shrek, Bielenberg’s team found that one of the technical obstacles was keeping track of where light didn’t go: the shadows. When you look at someone’s hair, part of the texture you detect comes from the thousands of darker areas blocked from the light by other strands. “Without shadowing, the hair often looks like it’s glowing, like it’s a light source itself,” Bielenberg says. Eliminating that artificial glow turned out to be the critical challenge Bielenberg and his colleagues faced in animating one of Shrek 2’s new characters: a talking cat named Puss in Boots, who looks at first glance like an adorable little kitten but turns out to have a Zorro complex. (The character’s voice is provided by Antonio Banderas.) Viewers will most likely take for granted that Puss in Boots has a believable coat of hair. But calculating all the shadows cast by individual strands of hair as they shift with the slightest movement—not to mention more dramatic gestures like the heroic knight’s Breck Girl flip—can take dozens of hours to process, even on high-powered computers.

Another challenge comes from objects on which the light doesn’t stop at borders but penetrates in a process known as subsurface scattering. When Alfred Hitchcock famously buried a lightbulb in a glass of poisoned milk in Suspicion to heighten its eeriness, he was exploiting the fact that light flows through milk in a distinct way. The natural world turns out to be filled with subsurface scattering. The distinct look of human skin, for instance, is determined by how light penetrates its surface. Eliminate subsurface scattering in animated faces and everyone looks like a porcelain doll.