Wētā Digital – now part of Unity – developed many of the tools and solutions used to bring the world of Avatar: The Way of Water to life. Here, we take a look at the CGI technology behind the water. If you’re interested in being among the first to access some of the tools used in the film, you can register for the Unity Wētā Tools beta through our website.
James Cameron is no stranger to working with water. Titanic aside, in 2012 he made a record-breaking solo dive, piloting a submarine to the bottom of the Mariana Trench in the Pacific Ocean: Earth’s lowest point at nearly 11 kilometers deep. As he said in the resulting 2014 documentary, Deepsea Challenge, “Down here you feel the power of nature’s imagination, which is so much greater than our own.”
It must have been truly remarkable, then, seeing as the world of Pandora and its stunning visuals ultimately came from Cameron’s own imagination.
Translating Cameron’s vision, which for the sequel included the new reef village of the aquatic Metkayina clan, required extensive use of visual effects – especially for the dominant water setting.
To ensure that the interactions between the characters and water elements were as realistic as possible, a team of experts, including Unity and Wētā’s water simulation VFX specialists Alexey Stomakhin, Steve Lesser, Joel Wretborn, and Sean Flynn, were brought together to form the “Water Taskforce”. This team’s water toolset was recently recognized with a win at the Visual Effects Society (VES) Awards, with the Emerging Technology Award.
Extreme attention to detail saw the taskforce conduct extensive research and experimentation in collaboration with New Zealand’s National Institute of Water and Atmospheric Research (NIWA) to find the best approach to creating CGI water. This included taking into account the effects of tides, wind, and the sea floor on aquatic environments.
Avatar: The Way of Water required water effects for 2,225 shots, some taking up to eight days of simulation to achieve the high resolution needed.
There were also numerous scenes where water interacted with over 50 creatures in a single shot. This presented the challenge of needing simulations to be accurate at scale, from large domains for bigger creatures, to submillimeter resolution for thin film on skin.
As it was not computationally feasible to create a single-representation water system, the toolset was developed with a number of distinct solvers to keep compute times to a minimum.
“The Loki water state machine was crucial for delivering the sheer volume of large-scale water shots in this movie. In a typical VFX-heavy movie, water shots of this complexity are few and far between and require many iterations and passes from very experienced artists. In contrast, our state machine approach was able to deliver great results after just a single pass, even by artists who had just entered the industry.” – Sean Flynn, simulation lead, Unity x Wētā Digital
A majority of the water tools developed by the team sit within Wētā’s proprietary simulation framework, Loki. This piece of tech includes solvers for multiple water states, including procedural water waves, bulk water, spray, mist, hero bubbles, diffuse bubbles, foam, capillary surface waves, thin film, and residual wetness.
Many of these solvers sit within the Loki state machine – an airborne spray system. The water states are coupled with the surrounding air, with transitions between states handled in a mass- and momentum-conserving way.
Rather than a one-size-fits-all approach, the Loki state machine allows multiple solvers to run in tandem. Each solver is optimized for the level of detail required by its respective state, such as bulk water, spray, and mist. This helps keep large-scale water simulations efficient while still capturing the very fine droplet interactions required by spray and mist.
All of the states including the surrounding air are completed in a single simulation pass. As all solvers are computed with proper physical interactions between them, this is what helped to create such natural and realistic water interaction throughout the film.
During SIGGRAPH 2019, a practical approach for modeling close-up water interaction with characters was presented, with a focus on high-fidelity surface tension and adhesion effects as water moves over and drips from skin. Using a scene from Alita: Battle Angel (a screenplay also written by Cameron), the team showed how this method allowed for a resolution of effects that was performant enough – on the scale of a fraction of a millimeter – to cover a whole character with a layer of water.
The approach was to adapt an existing particle-in-cell (FLIP/APIC) solver to capture small-scale water-solid interaction dynamics. This technique was then advanced during the production of Avatar: The Way of Water to handle any sequence that involved characters emerging from water.
“This was not a cheap solution, as we had to simulate water dynamics at sub-millimeter scales. The results would often take days to compute. We had to ensure our solver was scalable, robust and reliable enough to produce physically plausible visuals out of the box, with minimal tuning required from artists.” – Alexey Stomakhin, principal research engineer, Unity x Wētā Digital
To achieve believable dynamics in underwater scenarios – for example, when characters breathe underwater in Avatar: The Way of Water – the approach to underwater bubbles was to simulate them together with a narrow band of water around the region of interest. The bubbles themselves would be represented in two parts: a hero and diffuse counterpart.
The hero counterpart captures bigger bubbles with more explosive and turbulent behaviors. It utilizes an incompressible two-phase Navier-Stokes solve on a Eulerian grid, with the air phase represented by FLIP/APIC particles to facilitate volume conservation and accurate interface tracking.
The diffuse counterpart captures the motion of smaller bubbles below the resolution of the Eulerian grid. The team has developed a novel scheme for coupling diffuse bubble particles with bulk fluid that could also be applied to other submerged, porous objects such as sand, hair, and cloth.
To enhance the visual detail of a water surface simulation, the team from Wētā Digital and IST Austria developed a method of post-processing that took a simulation as an input, and increased its apparent resolution by simulating detailed Lagrangian water waves on top of it.
Linear water wave theory was extended to work in non-planar domains with Lagrangian wave packets attached to spline curves that would evolve over the bulk fluid surface. This method produces high-frequency ripples with dispersive wave-live behaviors, customized to the underlying fluid simulation.
A technique was developed for the realistic movement of underwater bubbles – created by movement in the water – reaching the water surface and converting into foam. This was important for nearly all of the water scenes in Avatar: The Way of Water.
Grid-based Navier-Stokes simulators – usually reserved for capturing large-scale motion such as bulk fluid – are inherently limited by their grid resolution, making this method impractical for small-scale phenomena like spray and mist from breaking waves. These whitewater effects are usually simulated as independent Lagrangian particles.
“One key aspect of our whitewater method is the interaction of two solvers: a grid-based fluid solver coupled with bubbles, and a SPH solver for foam constrained to the water surface. The declarative solver framework in Loki is what makes building and supporting these complex systems possible in production without having to develop new solvers from scratch.” – Joel Wretborn, senior research engineer, Unity x Wētā Digital
The key aspect most of the existing solvers neglect are the collective effects: groups of bubbles rise faster than single bubbles due to their combined buoyancy, and the collection of many bubbles can have a significant impact on the motion of the water.
The new technique addresses this limitation by simulating bubbles two-way coupled with the surrounding fluid. This effectively captures collective bubble effects, and creates a more connected look between bubbles and the motion of the fluid. As bubbles reach the surface they transition into "wet" foam particles constrained to the water surface, discretized with smoothed particle hydrodynamics (SPH). In the end this created believable whitewater dynamics in both close-up and large ocean shots.
The simulation technology used by the Water Taskforce was created by present and former colleagues at Wētā Digital, as well as friends from Wētā FX and academic institutions, including: Alexey Stomakhin, Joel Wretborn, Kevin Blom, Gilles Daviet, Steve Lesser, John Edholm, Noh-Hoon Lee, Eston Schweickart, Xiao Zhai, Sean Flynn, Andrew Moffat, Gary Boyle, Tomas Skrivan, Andreas Soderstron, John Johansson, Christoph Sprenger, Ken Museth, and Chris Wojtan. Learn more about Unity Wētā Tools beta.