IPAM Studios Research in Industrial Projects for Students Summer Session 2003 Secret Agent : The Lava Lamp of Doom Quang-Thu (Victoria) Huynh, University of Houston Kang-Yu Ni, University of California, Santa Barbara Nemanja Spasojevic, Massachusetts Institute of Technology Jan Sýkora, Charles University Dr. Doug Enright, Faculty Mentor/R+D Technical Director Dr. John Anderson, Industry Mentor/Special Effects Supervisor 1 The Company[CGIMag.com, Cinefex 64, Cinefex 76, Cinefex 81] Pixar Animation Studios is the industry leader in the creation of original stories in the medium of computer animation. Pixar has combined creative and technical artistry to create five of the most successful animated films of all time: Academy Award-winning Toy Story (1995), A Bug’s Life (1998), Golden-Globe-winner Toy Story 2 (1999), Monsters, Inc. (2001), and this summer’s animation hit Finding Nemo (2003). Previous to Finding Nemo, Pixar’s four films have earned more than $1.7 billion at the worldwide box office to date. Pixar is a publicly traded company (NASDAQ: PIXR) with a current market capitalization of $2.8 billion. Pixar Animation Studios was founded in 1986 after Steve Jobs purchased the computer graphics division of Lucasfilm, Ltd. from George Lucas for $10 million. Ed Catmull was named cofounder and chief technology officer. Ed Catmull is now the president of Pixar. Pixar premiered its first animated short film, Luxo Jr., at the annual SIGGRAPH computer graphics conference. Luxo Jr., Pixar For the next nine years Pixar focused on developing the technologies necessary to produce the first completely computer animated feature film. Pixar released several award winning short films including Red’s Dream, Tin Toy, and Knick Knack. Pixar continues to use short films to perfect new technologies. Also during this period of time Pixar produced several computer animated television commercials. In 1989 Pixar launched its RenderMan product, which has become the industry standard renderer to produce stunningly realistic imagery. In 1993 the Academy of Motion Picture Arts and Sciences bestowed a Scientific & Technical Award to the developers of RenderMan (Loren Carpenter, Rob Cook, Ed Catmull, Tom Porter, Pat Hanrahan, Tony Apodaca, and Darwyn Peachy). In addition the Board of Governors of the Academy of Motion Pictures Arts and Sciences honored Ed Catmull, Loren Carpenter, and Rob Cook with an Academy Award of Merit (Oscar) in 2001 “for significant advancements to the field of motion picture rendering as exemplified by Pixar’s RenderMan.” 1995 was a monumental year for Pixar. Pixar went public with an initial public offering of 6.9 million shares at $22 per share. The IPO raised $140 million for Pixar and was the largest IPO of the year, beating out Netscape Communications. Toy Story was released Thanksgiving Day weekend, marking a milestone in the movie industry as the first fully computer animated feature film. Toy Story became the highest grossing film of 1995, making over $358 million in worldwide box office receipts. With the release of Toy Story, the feature film industry was forever changed, demonstrating the near limitless possibilities of computer animation. The 77 minute movie had 1561 individual shots, all of which progressed down the production pipeline 2 from storyboards to modeling to layout to animation to shading and finally to lighting. Toy Story generated one terabyte of data and required 800,000 machine hours to render. To deal with the shear complexity of managing the entire production pipeline, three core proprietary software systems were developed: Marionette, an animation software system for modeling, animating and lighting; Ringmaster, a production management software system for scheduling, coordinating and tracking a computer animation project; and an enhanced version of RenderMan for high-quality, photo-realistic image synthesis (rendering). Walt Disney Studios distributed Toy Story as according to their 1991 three feature film distribution agreement with Pixar. John Lasseter, a former Disney animator and currently creative executive vice president of Pixar, directed and co-wrote Toy Story. He won an Academy Award for Special Achievement for his “inspired leadership of the Pixar Toy Story team resulting in the first feature-length computer animated film.” In 1997 Pixar released another short film, Geri’s Game, demonstrating Pixar’s ability to produce realistic skin and cloth effects. Also, Pixar and Walt Disney Studios superseded their previous feature film agreement, agreeing to produce five original computer-animated feature-length theatrical motion pictures for distribution by Disney. In addition, Disney and Pixar agreed to cofinance, co-own, co-brand, and share equally in the profits from these films. The following two years saw Pixar release two new feature films, A Bug’s Life (1998) and Toy Story 2 (1999). A Bug’s Life had a worldwide box office of $362 million, while Toy Story 2 grossed $483 million worldwide. Toy Story 2 was the first film in history to be entirely created, mastered, and exhibited digitally. Some of the technological breakthroughs seen in A Bug’s Life included: a subdivision surface modeling technology; new illumination models for translucent effects – a critical component in achieving the proper lighting effects seen in the “small” world inhabited by bugs as compared to the world we inhabit; a proprietary crowd system for animating hundreds of ants seen in the ant colony; new fire and rain simulators based upon particle systems; and a state-of-the-art digital editing system. Toy Story 2 leveraged many of the technologies developed for A Bug’s Life. These technologies allowed the models of the original Toy Story characters to take on a softer look and were shaded better as compared to the “plastic” look of the original Toy Story. Also, more controls were added to the characters to assist the animators. In addition more human characters, including the chief villain, toy collector Al McWhiggin, are prominently featured in Toy Story 2. As noted by John Lasseter, “We put a lot of focus and R&D into the creation of humans on this film. Humans are, by far, the most difficult thing for us to do; and though they worked well in Toy Story, we wanted them to be better.”[Cinefex 81, p. 34] New skin and hair models and facial articulation controls with more than 150 fine-tune controls for just Al’s head alone were developed. Advanced draping and cloth models were used to clothe the characters with loose-fitting clothing, instead of skin-tight outfits seen in the original Toy Story. Finally a “special effects team” was formed to deal with effects that didn’t fit within the modeling, animation, and rendering pipeline. This team generated imaginative solutions for a range of problems including modeling rocket exhaust, starfields, laser blasts, and reentry shockwaves. The combination of these technical advances helped Toy Story 2 to become the first animated sequel to outperform the original at the box office and win a Golden Globe award for Best Picture, Musical, or Comedy. 3 Pixar released Monsters, Inc. in 2001. The movie became the highest grossing animated film worldwide and the second highest grossing animated film ever, earning over $100 million at the domestic box office is just nine days. Monsters, Inc. featured many new technologies, including a highly advanced hair animation system on the monster Sullivan. Sullivan, who is one of the main characters in the movie, is also an extremely furry blue and purple monster. The only parts of Sullivan not covered in fur were the soles of his feet and the palms of his hands. Overall, more than 2 million hairs needed to be simulated on Sullivan’s body. The fur on Sullivan also was long, thick fur, in order to provide a more realistic look to Sullivan while he walked. After extensive R+D work, a specialized ‘keyhair’ control system was implemented which allow the animators a degree of control over Sullivan’s hair while at the same time reducing the overall number of hairs to be animated to a reasonable number. Also, a completely new cloth simulation system was created to animate the T-shirt of Boo, a small girl who befriends the monsters of Monster’s Inc. The newest member of the Pixar family of movies, Finding Nemo, opens on May 30, 2003. The movies welcomes a new host of characters from the young adventurous clownfish Nemo; his fretful father, Marlin, who goes looking for his lost son; Dory, a forgetful but relentlessly optimistic Regal Blue Tang; Nigel a peculiar old brown pelican; to Bruce a great white shark. The movie features the voice talents of Albert Brooks, Ellen DeGeneres, Geoffrey Rush, Barry Humphries, and others. Pixar is currently in production on The Incredibles (holiday 2004) and Cars (holiday 2005). Overall, Pixar Animation Studios and its employees have received more than 100 awards and nominations for its animated films, commercials and technical contributions. Pixar’s relentless pursuit of creative technical solutions to the needs of the underlying story have made Pixar’s films a unique mixture of cutting-edge visual special effects and good old fashion story telling and have placed them in a special place in film history. The Industrial Mentor/Special Effects Supervisor Dr. John Anderson is currently a Senior Scientist at Pixar Animation Studios. Before joining the special effects industry, John was a professor of atmospheric and oceanic sciences and founding chair of the computational sciences program at the University of Wisconsin-Madison. In 1998 John joined Industrial Light + Magic as a resident scientist in the areas of procedural effects and simulations. While at ILM, John created visual special effects for the productions of Jurassic Park III, Mission to Mars, The Mummy, The Mummy Returns, Pearl Harbor, Star Wars: Episode I – The Phantom Menace, Star Wars: Episode II – Attack of the Clones, and The Perfect Storm. John’s work on The Perfect Storm set a new standard in the computer animation of fluids. He developed a variety of CFD sim tools, allowing for the creation of 100 foot waves and incredibly stormy seas which were three dimensional in nature.[sgi Feature Archive] In addition to his ground breaking water effects work, John received a Technical Achievement Award from the Academy of Motion Pictures, Arts and Sciences for his role in the development of the ILM Creature Dynamics System, which has been used extensively on a variety of ILM productions including Star Wars: Epsiode II – Attack of the Clones. In 2001, John left ILM and joined Pixar to work on a variety of projects including the newest Pixar film, Finding Nemo. 4 Goal Pixar Animation Studios is producing a short film, Secret Agent : The Lava Lamp of Doom, featuring Buzz and Woody with a new character, Secret Agent , in a plot to stop the evil Dr. Goo. Dr. Goo has created a gigantic lava lamp which once fully operational, will cause the toys in Andy’s room to be cast into an unbreakable hypnotic trance. Consequently, they will be unable to play with Andy ever again. The fate of the toys in Andy’s room depends upon the combined abilities of Buzz, Woody and Secret Agent to stop Dr. Goo’s diabolical plan. In a key moment in the short, Dr. Goo dreams about his lava lamp fully functioning, to the terror of the inhabitants of Andy’s room. Since Pixar wishes to explore the possibility of incorporating a new three dimensional, multiphase liquid sim engine with heating into their production pipeline, we have been tasked with setting up a stripped down version of the production pipeline to pull off this shot. Objectives We will need to set up a stripped down version of the production pipeline. Part of our work will involve the modeling, shading and lighting of a lava lamp with and without the waxy “lava”. Since the accurate calculation of the transport of light through the scene is important in order to achieve the look we are seeking, we will use a sophisticated free-ware ray tracer. The Persistence of Vision Raytracer (POV-Ray) [PoV web site] is able to perform photon-mapping, which allows the ray tracer to accurately render refractive and reflective caustics in a photorealistic manner. Photon-mapping for ray tracing was pioneered by Henrik Wann Jensen [Jensen 2001]. Example of Reflective Caustics (PoV-Ray website) In order to complete the lava lamp, we will need to animate the motion of the waxy “lava” within the lamp. To achieve a believable look, we will enhance a pre-existing three dimensional multiphase liquid sim engine. The sim engine currently solves the three dimensional NavierStokes equations describing the motion of the liquid: 5 ( v ) 0 t v ( v v ) p [ (v v T )] g , t where v (u, v, w) , is the liquid velocity field; p is the pressure; is the density; is the viscosity; and g is the local gravity field. Note that since we are modeling a multiphase (two immiscible liquids) flow, the density and viscosity depends upon both space and time. We will track the movement of the interface through the use of an implicit function, , denoting the signed distance to the interface, e.g. regions which contain the waxy lava would have <0 while the surrounding clear liquid would be indicated by >0. The exact location of the interface is be given by =0. Since the interface moves with the underlying fluid velocity, the evolution equation for is given by v 0. t An implicit function (level set) representation of the interface naturally allows for topological changes to the interface, facilitating the animation of the pinching off and merging together of blobs of lava commonly seen in a lava lamp.[Osher and Fedkiw 2002] A complete description of the numerical methods that are used in solving the above equations for engineering style applications can be found in [Kang et al. 2000, Liu et al. 2000]. Slightly different numerical techniques are used to solve the above equations in an animation environment, namely faster first order methods are used to advance the equations in time and a semi-Lagrangian treatment of the advection terms are used. Also, on the coarse computational grids commonly used in computer animation, excessive amounts of numerical diffusion in the level set function needs to be controlled. This can be achieved by using a hybrid particle-level set method to track the motion of the interface. Further information concerning the use of these methods can be found in [Stam 1999, Foster and Fedkiw 2001, Enright et al. 2002(1), Enright et al. 2002(2)]. The result of utilizing all of these numerical techniques on a related free surface liquid model can be seen below, where water is being poured into a glass. While the previously described sim engine can physically model the motion of a constant density waxy lava suspended in a liquid of different density, it is unable to capture the hypnotic effect of the lava lamp, namely the up and down motion of the blobs of lava. If one observes an actual lava lamp in action, the upwards motion of the lava is due to the heating of the lava from below by a hot light. As the lava rises, it cools off and descends back towards the bottom of the lamp 6 and the cycle is repeated. Physically, the waxy substance making up the lava has a temperature dependent density. When heated, the density of the wax is slightly less than the surrounding liquid, causing it move upwards due to buoyancy. Once the wax cools off, its density is greater than the surrounding liquid, causing it to fall. So to capture this hypnotic effect, we will need to add a temperature dependent wax density to our model. We will also need model how the temperature throughout the lamp changes. Our model should allow for the convective transport, and diffusion of the temperature through the two immiscible liquids. We will also make the assumption (the Boussinesq approximation) that the density of each liquid phase is constant in all terms of the Navier-Stokes equations except for the wax buoyancy term, g , and all other fluid properties are constant. Taking these assumptions into account we obtain the following equation for the time evolution of the temperature field, T v T T , t where is the coefficient of thermal diffusivity. We will take a linear relationship between the temperature and density for the waxy lava, i.e. the buoyancy term in the Navier-Stokes equations becomes wax (1 (T Twax )) g , where wax is the constant reference density for the wax at Twax and is the coefficient of thermal expansion for the wax. We will numerically approximate the above temperature transport equation using some of the technology that has already been used to solve the Navier-Stokes equations. We will get used to the pre-existing Navier-Stokes solver by simulating boiling water in a box. The data produced will allow us to set up our rendering pipeline. While getting accustomed to how the sim works, we will work on creating the algorithms necessary to simulate our lava lamp. We will then test out our algorithms in two dimensions first to ensure that everything is working to our satisfaction before proceeding to a three dimensional implementation. Once the 3D sim is working, we will output frames from the simulation to our rendering pipeline in order to obtain a realistic look for the lava. From the rendered frames, we will produce an animation. We will use daily animation review sessions in order to perfect the lava lamp simulation and ultimately produce the best looking animation possible. References [CGIMag.com] Brooker, Darren, “Men in white coats.” Computer Generated Imaging – The Technology of Entertainment. March 2002. <http://www.cgimag.com/technology/ randd_march02.shtml> [Cinefex 64] Street, Rita, “Toys Will Be Toys.” Cinefex v. 64 (1995) : 76-91. [Cinefex 76] Vaz, Mark Cotta, “A Bug’s Life: An Entomological Epic.” Cinefex v. 76 (1999) : 41-44, 49-50, 133-134, 139-140. [Cinefex 81, p. 34] Shay, Estelle, “Beyond Andy’s Room.” Cinefex v. 81 (2000) : 31-34, 39-40, 127-130. [sgi Feature Archive] “SGI at ILM: Bringing The Perfect Storm to Life”, September 2000. < http://www.sgi.com/features/2000/sept/perfect_storm/> 7 [Enright et al. 2002(1)] “Animation and Rendering of Complex Water Surfaces”, ACM SIGGRAPH 2002, 736-744 (2002). [Enright et al. 2002(2)] “A Hybrid Particle Level Set Method for Improved Interface Capturing”, J. Comput. Phys. 183, 83-116 (2002). [Foster and Fedkiw 2001] “Practical Animation of Liquids”, ACM SIGGRAPH 2001, 15-22 (2001). [Jensen 2001] Jensen, Henrik Wann, “Realistic Image Synthesis Using Photon Mapping”, AK Peters (2001). [Kang et al. 2000] Kang, M., Fedkiw, R., and Liu, X.-D., “A Boundary Condition Capturing Method for Multiphase Incompressible Flow”, J. Sci. Comput. 15, 323-360 (2000). [Liu et al. 2000] Liu, X.-D., Fedkiw, R., and Kang, M., “A Boundary Condition Capturing Method for Poisson’s Equation on Irregular Domain”, J. Comput. Phys. 160, 151-178 (2000). [Osher and Fedkiw 2002] Osher, S. and Fedkiw, R., “Level Set Methods and Dynamic Implicit Surfaces”, Springer-Verlag 2002. [PoV website] <http://www.povray.org> [Stam 1999] Stam, J., “Stable Fluids”, ACM SIGGRAPH 99, 121-128 (1999). 8