Kicking Back
Issue: Volume 34 Issue 5: (May 2011)

Kicking Back

Poor Po. In Kung Fu Panda, he finally achieved his dream to fight alongside the Furious Five, who protect the Peaceful Valley with their unique styles of kung fu. And then what happens? The people at DreamWorks Animation bring Po back for Kung Fu Panda 2 and give him a new villain, a treacherous albino peacock named Lord Shen, who commands an army of brutal wolves. Worse, the nasty bird is manufacturing a new secret weapon in his family’s fireworks factory, a weapon designed to destroy kung fu. So, take that, aspiring kung fu master.

“It’s an animated film, so we can do what we want,” says director Jennifer Yuh-Nelson. “Po is still the same guy. He doesn’t change into kung fu dude. But everything he believes in is in danger.”
 Yuh-Nelson, who was head of story for Kung Fu Panda, brought back most of the cast and crew from the first film to help Po battle the latest villain. Jack Black again voices Po, Dustin Hoffman is master Shifu, and Seth Rogan (Mantis), Angelina Jolie (Tigress), Jackie Chan (Monkey), David Cross (Crane), and Lucy Liu (Viper) are the Furious Five. Joining the voice cast is Gary Oldman as the peacock Lord Shen.

But the story has an emotional side, as well. “We’ve met the characters, so we have the opportunity to get to know them in more depth,” Yuh-Nelson says. “It’s a sweet, heartfelt story.” A story that plays out on a far bigger stage in this film—emotionally and physically.

“We had the opportunity to add more scale and ingredients because of technical advances,” Yuh-Nelson says. “We didn’t reinvent the look; we stayed true to the first film. But, we expanded the playground. For the first film, we fleshed out more of the world than we let on. In this film, we get to see characters and backgrounds, and parts of the environment we didn’t get to play with. The characters start in the same place, but we widen the scope.”

Yuh-Nelson singles out three areas in which technical advances allowed them to broaden and deepen the kind of movie they made. First, Lord Shen. “We could never have done that guy in the first film,” she says. “He’s so complicated. He moves fluidly, but he’s complicated.”

Second, the playground. “In the first film, we had to cheat the distance people traveled because we didn’t have the ability to make an environment beyond a certain size,” Yuh-Nelson says. “The limitation was a few blocks at most. Now we can make an entire city, so we can have a character run from one side of the city to the other. And, we could increase the number of characters in a shot.”

Third, stereo 3D. “We didn’t do stereo 3D for the first film, so the environment is more immersive in this film,” Yuh-Nelson says. “And, the action is enhanced by the 3D aspect.”

Lord Shen
In addition to rigging the new characters, because the studio has advanced the proprietary rigging technology since the first film, the Kung Fu Panda 2 crew had to re-rig all the original characters. “We tried to make them look the same,” Yuh-Nelson says. “But, they all had to be rebuilt.” (For a look back at the work done on the first film, see “Stuffy Fight,” June 2008.)

But that work paled next to the task of rigging the albino peacock. “The peacock represents the pinnacle of all the challenges we had,” says Alex Parkinson, visual effects supervisor. “He was the hardest character, but he was one of the most important characters, so that justified the work we put into him.”

Supervising animator Rodolphe Guendoen choreographed the fighting style for Lord Shen, as he did for all the characters in this film and the first film. A martial arts practitioner himself, Guendoen developed and supervised the fighting sequences. “I would explain each of the moves by drawing traditional animation passes and give those to the animators,” he says. “It was faster to sketch out the key poses for the choreography by drawing them than by jumping on a machine and doing them in CG.”

For each of the Five, Guendoen had developed a fighting style in the first film based, as much as possible, on various forms of kung fu—monkey, tiger, and so forth. The character Viper, for example, uses a viper style of fighting, minus the biting. “She’s just a long tube, so having her do kicks and punches and conveying a silhouette that differentiates between them was a good challenge,” Guendoen says. “We would shift her breaking point from her lower body to her upper body. When she coils around a wolf, we used two viper models and hid the head of the second one because otherwise the skin texture would break.”

The Rhino, a kung fu master who guards the city and a new character in this film, fights by leaning his head, neck, and upper body forward, and uses his horns to deflect blades that Lord Shen throws at him. The Bull, a similarly massive second guard, also uses his horns to fight. “For every character, we try to look at their physical attributes and play with that to create their own style on top of the basic academic training,” Guendoen says.

In addition, for Po, Guendoen needed to consider his level of training. “He had to be more accomplished than in the first film, but he’s still in training,” he says. “He’s not as accomplished as Tigress, he doesn’t have the same level of confidence, so we show that in his breathing and rhythm. It takes a lot of energy for Po to fight.”

To create Po’s style, Guendoen referenced baby pandas. “When we went to China, we saw baby pandas bumping each other, being super cute. There was a lot of rolling into giant fur balls, and we thought it would be fun to include that. So in Po’s panda style of kung fu, we have a lot of rolling, tumbling, and a lot of comedic improvisation.”

Creating a style for Lord Shen was more difficult. “His appearance isn’t threatening,” Guendoen says. “He’s a big bird. But, we had to make him menacing. So, we did that with his posture, his intensity, and his fighting.”

Because Lord Shen is a sword master, Guendoen started with a traditional sword-fighting style, and then he discovered rhythmic gymnastics. “The Beijing Olympics happened when we were developing the movie, and I saw these rhythmic gymnastic girls throwing ribbons, doing these weird moves with incredible flexibility. So that became an inspiration. Through the movie, the peacock is almost creepy in his flexibility and movement. He has a twisted way of handling his sword—but still with pure grace. Until he actually loses his mind and gets frantic.”

As always, Guendoen choreographed Lord Shen’s shots with pencil and paper in traditional animation style. “I had him doing all these moves with swords, passing his legs over his head,” he explains. “We also played a lot with his tail, using it almost as another weapon, a fifth limb. He’s a sneaky guy. He’d sweep open his tail and block with it to hide his opponent’s vision so he could strike in a treacherous way. It was cool. I didn’t know how complicated it would be to rig the CG character. In drawing, you can cheat a lot. But we [also] found ways.”

Fighting Feathers
Lord Shen’s “tail,” of course, is made of individual feathers that can splay open like a fan or fold over each other and close. “It’s like six tail rigs all combined,” Parkinson says. “It represents all the work we did on Crane, on Viper, and on the tail rigs for Monkey and Tigress.”

Originally, the crew planned to have the peacock fan his spectacular tail only as a one-off special move, but as soon as everyone saw how good it looked, it became impossible to resist. “Animators had multiple levels of control,” Parkinson says. “They could move individual feathers, but in general, they used a higher level of control that’s spline-based, to hit specific shapes to fan and bend the feathers; we define the shapes based on particular controls. The big problem, as with all feathers, was the interpenetration. We have multiple layers of feathers that we needed to keep apart. We achieved that in the rigging.”

The crew used some of the same techniques developed for Crane to feather the rest of the villain’s body, but placed more complicated procedural feathers on his neck and “hands.” “The peacock uses his feathers as fingers, so we added complexity to the rig to keep those feathers out of each other’s way,” Parkinson says. “We had developed software for the first Panda movie that treats hairs like individual NURBS surfaces, which is what keeps them apart. So, when the peacock bends his neck and the feathers splay out, they don’t interpenetrate. On top of that, we have a shader that creates the individual hairs. When you look at the feathers, you see that they have individual barbs, which adds complexity to the character.”

Also adding complexity is the lordly peacock’s robe, a second challenge. “We didn’t want to cheat,” Parkinson says. “We wanted him to wear a single outfit when he’s standing regal and kung fu like, and when his action starts.” In the classic kung fu pose, the peacock folds his wings and poses like a monk, with his hands in his sleeves and with the sleeves together. When his tail is down, the robe forms a train-like shape.

“This huge train sticks to his tail and becomes part of his shape,” Parkinson says. “But if he spins round, it flies out and off the tail. We thought of having him change into an easier outfit, but our character effects department created a complex set of controls on the robe so it follows him and also can flow and accentuate his motion. It was the hardest cloth we had to do, but it really works with the animation.”

To simulate the cloth, the effects artists used Qualoth, a Maya plug-in from FXGear. They would first look at an out-of-the-box simulation based on the underlying performance, and then tweak and mold the cloth to achieve a more artistic look. “Qualoth is the base, but we built a lot of controls on top that the character effects animators used,” Parkinson says. “They would even get to the point of shaping the cloth by hand using individual deformers.”

As with Lord Shen, all the characters were dressed with simulated cloth to layer the stylized performances with realistic motion. “The simulated cloth adds a sense of gravity,” Parkinson says. “If you have a fantastical world without the sense of gravity, you don’t get as much impact from the action sequences. The challenge is to get movement with a sense of weight with cloth that sticks with the character.”

 Deep Emotion

DreamWorks Animation initially tested stereo 3D with a shot from the Tai Lung fight sequence in the original Kung Fu Panda. That test helped persuade the studio to design all future features with stereo 3D in mind. DreamWorks’ first stereo 3D film, Monsters vs. Aliens, released in 2009, lent itself to stereo gags—elements exploding out from the screen. By the time work began on How to Train Your Dragon, released in 2010, stereoscopic supervisor Phil McNally had developed a tool called “Happy Ratio” that, based on the distance of objects and the camera lens in a shot, set default interaxial and convergence; that is, the roundness of objects (the volume) and how far away or close they would appear (depth). That tool and others gave the artists more time to experiment with the stereo design for each film’s unique story.

For example, McNally and head of layout, Yong Duk Jhun, began playing with depth of field in Shrek Forever After, using a blending technique that moved characters subtly in depth through a shot to intensify an emotional story point. In Megamind, McNally and Kent Seki discovered new ways to compose spatially interesting shots using, for example, a clothesline with bits of paper hanging in space and, most notably, deep reflections.

With Kung Fu Panda 2, layout supervisor Damon O’Beirne pushed the artistry of stereo design further. “We tried a very different approach to stereo,” he says. “Before, we concen­trated on getting volume into our stereo. This time, we concentrated on keeping the point of interest ‘on screen.’ ” “On screen” is the point at which the left and right images sit on top of each other. This technique is not a new concept in stereoscopic design—James Cameron employed it for Avatar, and Bob Whitehill often sets stereo depth based on point of interest for Pixar’s films—yet O’Beirne found it particularly useful for this film.

“Keeping the point of interest on screen really helped us because one of our big challenges was that the camera and the character are super dynamic,” O’Beirne says. “Everything moves so fast, making sure we could get a good read on the characters was important. When the eyes are ‘on screen,’ it’s like looking into the character’s soul.”

The artists then began using stereo to enhance the story. “We have a concept of ‘story stereo,’ ” O’Beirne says. “We use stereo to underline or contrast the story over the whole course of the movie. If we want something to be disturbing or unnerving for the audience, we tend to go deep. When we want the audience to feel comfortable, we go flatter. All cinematography is about the juxtaposition of one shot to the next, and the ability to do that with stereo made the film fun to work on. We used the contrast from shot to shot to create visceral impact.”

For example, during the battle, the stereo artists might set the camera at the Happy Ratio, then as an explosion bursts on screen, reduce the volume to 75 percent, 25 percent, five percent, and then pop it back to 100 percent in the next shot.
“Moving the volume around in space changes the feeling,” O’Beirne says. “I like to think of it as air. If you’re [taking a picture] in Montana, you open the lens to get more space in the shot. It’s the same with stereo. You can take more and more air out of a shot, and then, suddenly, add it back in. In our movie, depending on the story, we’d rest the stereo for a while in flat space, then go into deep sequences, and then flat, deep, flat, deep to create contrast. It’s very effective.”

O’Beirne and his crew used this technique in one of his favorite sequences, and one of the most emotional in the film. O’Beirne calls it the “truth sequence.” It starts with Po floating in a river.

“When a soothsayer finds Po and takes him to a village, we reduce the stereo to middle range,” O’Beirne says. “There, Po is standing in the rain in an old, destroyed panda village, and memories flood in. We make sure his eyes are perfectly set on the screen so the audience connects with him. He catches a raindrop and starts to do an amazing water-drop kung fu move. As he does that, the shot dissolves into 2D artwork, traditional animation of nightmare scenes from his past, and we go deep. When we have positive images from his childhood, we make the 2D a bit flatter. Within this one sequence, we have a gamut of techniques and stereo settings. And, Ramon did fantastic lighting, green and then neutral, and then flashbacks with white and red, and very graphic. It’s an incredible sequence.”

To move the flat artwork, the traditional animation that plays out Po’s memories, the stereo artists layered sheer surfaces in Adobe’s After Effects and angled the artwork toward the viewer to create a feeling of depth. “It’s like looking down the edge of a wall,” O’Beirne says. “I’m excited to see how audiences respond.”

The crew pushed the stereo artistry even further for the IMAX version of the film. “We wanted the stereo to be great for the general audience, but we thought the IMAX audience wanted an even bigger experience, so we looked at moments where we could push things farther back and make them bigger,” O’Beirne says. “We’ll know we’ve done our job well if little kids reach up to touch the elements.” –Barbara Robertson

Armies of Wolves  
One of the biggest differences between the first and second film is the kind of action that takes place. In Kung Fu Panda, the fighting was mainly one on one. In the sequel, Po and the Furious Five fight Lord Shen’s army of wolves. In fact, early in the film, during one of the first sequences in which we see Po in action, he and the Furious Five battle a pack of wolves, and in doing so, develop an important story point.

“We have maybe 20 or 30 wolves on screen, piling on Po and the Furious Five, who fight together in a balletic way,” Guendoen says. “We wanted to show Po is still in training but living his dream. We wanted to be sure the audience witnessed Po as part of the Furious Five (I guess Furious Six now). We had to hit that story point. So, it was very challenging.”

Not as challenging, though, as the final battle in which Po and the Furious Five fight an army of wolves riding in boats. “It took hours to plan it,” Guendoen says. “All those sketches I did. I had to plan that after a wolf was hit and flew out of camera, we could re-use him as another wolf coming in. Like a loop. Otherwise, the scenes would be too heavy to handle because there were so many characters on screen.” The wolves don’t practice kung fu; after all, the peacock wants to eradicate kung fu. Instead, they’re brawlers. “They’re feral,” Guendoen says, “and they have a lot of weapons.”

The climactic battle takes place over several sequences, which include crowd simulations for the wolves as well as hero animation. For the crowd simulations, DreamWorks turned to Massive software, which the studio had tested on Megamind (see “Mind over Matter,” November 2010).

“We wanted to use it for our battle sequences to get great performances out of the crowds,” Parkinson says. “It was important to have the good-guy characters among the army doing hand-to-hand fighting.”

During the battle, the hero characters run and jump from boat to bobbling boat filled with the feral Massive-controlled wolves. The system for keeping the boats rocking with the currents and the wolves planted inside started with layout. “Layout installed the boats in a basic position,” Parkinson says. “We created the ambient motion of the water with a noise function, that is, a fluid simulation. The battle isn’t in the middle of a storm; we just had to keep the water alive.”

The effects artists parented the wolves to the boats and moved the boats using the same noise function that moved the water. “So everything had a base movement to it,” Parkinson says. “Then, we gave animators control so if they had a hero character land on a boat, they could tip it or move it in some way.If they did, because we had parented the crowd characters to the boats, they’d stick to the motion of the boat. But, we had to send the shots back to simulation to add ripples and splashes in the water.”

For water simulations, the effects department uses proprietary software, Autodesk’s Maya, and Side Effects’ Houdini. “The choice depends on the skill set of the artist and the nature of the effect,” Parkinson says. “Houdini’s strong point turned out to be creating stylized motion in the water, and we used proprietary software for the interaction.”

Similarly, the artists turned to all three solutions as appropriate for fire, explosions, and destruction. As the story goes, Lord Shen perverted the family’s fireworks factory into a weapons-manufacturing plant, and the explosive result sparked several sequences in the film.

“In the first [Panda] movie, we had to be careful about what we broke,” Yuh-Nelson says. “During the battle with Tai Lung, we punched one building and a gate. It looked good, but that’s all we could do, and it was complicated making that one building collapse. Now we have more ability to destroy things convincingly. We don’t have to stop with one small building. So, we took advantage. But, not for bling. Everything is character- and story-based; we aren’t just flapping around making noise.”

The effects crew, however, took advantage of their expertise to slip a little bling to the action, anyway. “We’ve gotten good at blowing things up and knocking things down, but we wanted to push the effects,” Parkinson says. “Because [Lord Shen’s] family had been in the fireworks business, we decided to give everything a fireworks sparkle. A building might crumble realistically, but we added a firework effect to the destruction. Hopefully, it’s an original kind of look.”

Red Versus Blue
The combination of fire and water meant the lighting crew faced the same problem that they had in the first film, the battle of red and blue, and not only during explosions, but also because the sequences take place on a moonlit night and each boat is lit by torches. Lighting supervisor Dave Walvoord explains. “We describe Kung Fu Panda 2 as an alternate universe,” he says. “It’s a place where animals talk and do kung fu. But, there are a certain physics in this world. It’s not present in our world, but it’s rigorous. There is a certain way light should behave, and that helps create the style of the movie.” To hold true to the alternate physics in the Panda world, the lighting team developed a set of rules, and one rule caused the battle between red and blue. “We don’t allow lights to mix,” Walvoord says.

In the first movie, the design of Tai Lung’s prison-escape sequence called for strong blues and reds, but the problem arose when red light and blue light mixed: The light became purple, and they could not have any purple in the sequence. “At first we tried using the lights like paint,” Walvoord explains. “Like when you paint red over blue in Photoshop so they don’t mix, but it looked horrible because the lights started behaving like paint. Light is so important for understanding space, and we were destroying space. We didn’t know who was going where.”

Instead, to keep a strong red and a strong blue and nothing between, they placed lights so the two wouldn’t mix naturally, and inserted rocks and shadows to block the light and further keep the colors from mixing. “It was not natural at all,” Walvoord says. “But it kept our design quality.”

So, when the lighting team saw red fire over blue water in Kung Fu Panda 2, they knew they would need to correct the same problem. “It took a lot of handwork,” Walvoord points out. “There is so much action, such quick cutting, such strong colors between red and blue, and it’s very dark. It was the worst-case scenario for trying to light a sequence so the audience could follow and understand the action. We had hundreds of wolves fighting and hero characters running, so visually there was a lot going on in a frame. It took artistry, not technology.”

The lighting crew decided that real-world physics aside, everything in the foreground would have higher contrast than the background. Also, they would use the torches as key lights and turn the moonlight into fill light. “We always have a single direction of light,” Walvoord says. “Even when there are two lights in a scene, one is dominant. So the torches are the dominant light and the moon is the bounce light. That’s not exactly how it would work in real life, but we tried to find a basis in what a camera would do and skewed it for our stylized world.”

There were other rules for the film, as well. The lighters always maintained what Walvoord calls “hue identity” by increasing saturation when hue values decreased. “The rule is, ‘Never let your darks get dirty,’” he says, adding, “keeping the colors clean is something painters do intuitively.”

A third rule also brought painting principles into play. “We use global illumination, just like everyone, but we have little hooks so that right before the light bounces back out, we can nudge it somewhere else,” Walvoord says. “We intercept the light and make it change color.”

Walvoord uses the example of Po standing outside on a stone floor: Warm sunlight hitting the floor bounces an orange color into the panda’s shadow, and that color mixes with light from the blue sky. “The warm orange and cool blue bleed together and neutralize,” Walvoord says. “Lots of people brag about using color bleeding, and it’s a gorgeous look. But, it fights the graphic design part of the world we are trying to create.”

So, to keep the richness that bouncing light contributes to a scene, they found a way to shift the color. The light still bounces, but it bounces with the color they choose. With this technique, the light in the scene with Po on the stone floor would be strongly warm outside his shadow and strongly cool where the sun doesn’t shine. “We have a warm side and a cool side separated by a shadow,” Walvoord says. “It’s a clean graphic read. If we do that too much, though, it doesn’t look right with the world. So, we light the scene until it fights our design principles, and then we nudge it as little as possible.”

For one of the most emotional scenes in the film, the artists kept the lighting completely cool. “It’s a sequence when Po remembers what happens to his family and how he got to be where he is,” Walvoord says. “It’s an overcast, rainy, gray, foggy scene. We lit it blah. If you look closely, it’s still the Panda world, but there is a lot less detail. We’re always looking for ways to drive points home with contrast, and this is a point in the movie where all the saturation backs off. It feels like one of those cold, rainy days when you just don’t go anywhere. It provides a calm springboard for the 2D flashbacks, which are saturated, violent, and emotionally intense.”

Working with the lighting team to heighten the contrasting emotions in this sequence was the stereo 3D team, which devised artistic ways to use stereoscopy, even for flashbacks created with 2D artwork (see “Deep Emotion,” pg. 10). Fighting choreographer Guendoen helped create these traditional animation dream/nightmare sequences in which Po discovers his past and the audience learns more about Po. But, it isn’t the only technique used to expand our understanding of Po and for Po to learn more about himself.

“We take Po out of his comfort zone,” Yuh-Nelson says, “across China, to a challenging place for him, a large metropolis by ancient Chinese standards.”

To build the city, the team experimented with procedural modeling techniques and then decided to create 12 city blocks, some in a poor to modest style and some in a more affluent architectural style. “We physically modeled the entire city and created the different looks with surfacing,” Parkinson says. “We could position and orient the blocks in various ways so you wouldn’t see the repetition.”

In town, a population of new characters also added visual complexity. “In addition to our geese, pigs, and rabbits, we now have sheep and antelope,” Parkinson says. “So we had to create animation cycles for five different species that act in different ways. The antelopes are tall and the sheep are round and fluffy with an amazing wool bib that we put on them. They’re cool characters. Having so many species adds complexity to the crowds and makes our city a bustling metropolis.” For the environment around the city, though, the artists created matte paintings.

Production designer Ramone Zibach designed the Panda universe for the first film, and his vision carried into the sequel. “He took the best of design principles from 2D, the quick, simple reads, the simplicity, and moved them into 3D,” Walvoord explains. “Po’s black reads simply and elegantly against the sky, but when you turn the lights on him, he has gorgeous fur detail, with all the richness of a 3D world.”   

For the director, the crew, and the millions of fans who kicked the first film into an Oscar-nominated box-office hit, it’s a world happily revisited. “I didn’t sign on just to be a director,” Yuh-Nelson says. “I wanted to keep going in the world in whatever capacity I could. It was fun to have had the opportunity to do that.”

Barbara Robertson is an award-winning writer and a contributing editor for Computer Graphics World.