Tuesday, January 29, 2008

The Maelstrom
Pirates of the Caribbean: At World's End



Disney's Pirates of the Caribbean franchise has been rightfully praised for dazzling character animation, but its CG cast isn't the only advanced animation created for Pirates by San Francisco-based Industrial Light & Magic (ILM). The third film in the series, Pirates of the Caribbean: At World's End, also required sophisticated digital simulations of the briny deep — especially during a 15-minute sea battle in which an ocean maelstrom plays a pivotal part. As two ships sail towards each other, lightning strikes and swelling seas signal an ominous storm. In the water between the ships, the ocean swirls dangerously, crashing against the vessels as the battle plays out.

Despite its realism, this is nearly total animation, because the ships (as well as the water) are 3D CG. The only photographed elements were practical foreground rain and matte-painted sky elements, says ILM CG supervisor Joakim Arnesson. A veteran of Poseidon, Pirates of the Caribbean: Dead Man's Chest, and The Perfect Storm, Arnesson is one of ILM's water-simulation experts, but when he saw director Gore Verbinski's storyboards for the third Pirates film, he recalls thinking, “This is a lot of work.”

Verbinski supplied a previz created in Autodesk Maya, which he wanted ILM to match. Arnesson initially hoped they could avoid running computer-intensive simulations. “If we could get away with not doing sims, we wanted to. Doing work like this is about speed,” Arnesson says.

But tests showed otherwise. “We knew that we'd have to do a hero simulation, where you see the CG ships and the maelstrom interacting at the waterline, and see the splashes caused by the ships moving up and down in the water,” Arnesson says. “Our idea was to leverage the technologies we'd used on Poseidon — our fluid-dynamics engine and particle-simulation engine.

Pirates required one thing that Poseidon didn't have, which was a stormy sea with breaking waves and lots of spray. If you want a stormy sea, you have to run the fluid simulation up to the point where the waves start to break.” Simulating the maelstrom was complicated by the fact that the water had to flow at different speeds as the ships sailed in and out of it.

“We needed to generate so much data that you don't even see,” Arnesson says. “Sometimes everything works fine for camera, but other times you move the camera slightly and there are no particles there. Since we had to be able to move the camera around everywhere, it required a huge data set. We basically generated a 360-degree maelstrom.”

The software environment for this “virtual water tank” was ILM's proprietary system Zeno. The fluid dynamics engine that operates within this environment was written in collaboration with researchers from Stanford University, including Frank Losasso Petterson, who subsequently joined ILM and spearheaded the simulation for At World's End. “Frank ran most of the hero fluid simulations which showed how the maelstrom formed,” Arnesson says. “He ran some of the larger sims in 40 chunks using 40 processors. It took a very long time — I think he set some records.”

The hero simulation generated data that ILM's team could then use to spawn secondary particle simulations. ILM's inhouse particle-simulation engine runs in parallel with the fluid-dynamics engine, and the two engines can interact, according to Arnesson. “We got the level set of the ocean surface spinning around,” he says. “Then we got two different particle sets that had the velocity of how the water was spinning around. We used that to emit splash particles. Basically when a wave breaks, it emits splash particles. We wanted to have even finer particle sims for spray and mist. So there were sequential simulations, going from chunky particles to smaller and smaller ones. To get more detail in the finer particles, we jittered them so we got finer resolution of the droplets.

“Doing particle-effects animation involves two components: One is the motion of the data you're simulating, and the second part is how do you render it. We had to render this with things like specular highlights and transparency. What's the best way of getting the most resolution, given the computer's limitations? Can we get away with a million particles, or do we have to bump it up to a hundred million? We rendered hundreds of millions of particles for this show. We had to fake it a bit with noise patterns to make it look like water.”

Because the skies in the scene were overcast, the overall environment could be lit with soft key lights. “It helped us haze things up a bit,” Arnesson says. All of the rendering was done with Pixar RenderMan, and the process proved time-consuming. “There was a water pass, bubble passes, foam passes, splash and spray passes, and mist atmospherics. The renders took from a couple of minutes to 20 hours a frame. If it took longer than one night's render, we'd consider adjusting it so we'd have something to look at by the next morning.”

All of those passes had separations in them, so there were multitudes of layers to deal with when these elements were composited in Apple Shake. Having multiple channels of reflections and foam fractals created a lot of work for the compositors, according to Arnesson. “But it was crucial to be able to combine different sub-renders, so that if something didn't work, we had some flexibility to fix it,” he says.

The traditional problems associated with photographing miniatures in a tank have been greatly mitigated by digital water simulation, but some issues of scale still remain. “We can do distance to mid-ground really well,” Arnesson says. “The harder stuff is when you're close to camera, which is why people still augment CG water with practical splashes. We have better technology and massive computers, so we can add more convincing details. But water never gets easier to do — it just looks better!”

CREDIT ROLL

Director: Gore Verbinski
Visual Effects Supervisor: John Knoll
CG Supervisor: Joakim Arnesson
Fluid Sim Development: Frank Losasso Petterson
CG Supervisor (boats, drips, and atmospherics): Neil Herzinger
Sequence Supervisors and Lead TDs: Paul Sharpe, Kevin Sprout, Josh Levine
Lead Maelstrom Compositor: Fran├žois Lambert
Maelstrom Compositor: David Fuhrer

3 comments:

Adam J. Ely said...

Well worthy of the best vfx oscar!

Great work Dan!

wraith7000 said...

Let's see if this will let me post now....

wraith7000 said...

Hooray it does!