Liquid animations so realistic you can almost taste them
Cheriton School of Computer Science Professor Christopher Batty has developed a way to animate the behaviour of viscous liquids with accuracy that has eluded computer-animation researchers.
Cheriton School of Computer Science Professor Christopher Batty has developed a way to animate the behaviour of viscous liquids with accuracy that has eluded computer-animation researchers.By Joe Petrik David R. Cheriton School of Computer Science
Anyone who’s poured honey onto a stack of pancakes likely has been intrigued by the golden liquid’s motion as it oozes, buckles and coils like a rope. This behaviour is caused by the high viscosity of honey, a physical property of gooey liquids that makes them resistant to deformation.
Cheriton School of Computer Science Professor Christopher Batty has developed a way to animate this viscous behaviour with stunning accuracy, something that has confounded computer-animation researchers. This is perhaps not surprising, as Batty has been working on fluid simulation since 2004 when he was a software engineer at Frantic Films, a Canadian content and live action production company based in Winnipeg
“The computer-animation work I did as part of my PhD research could model the general behaviour of viscous liquids, but the animations didn’t capture the coiling effect,” Batty explains.
“We realized there was this missing connection between modelling the viscosity forces and the pressure forces in the liquid. So, we went back to our physical understanding of liquids and realized that the pressure and viscosity forces that act on them need to be solved together for the computer animation to be physically accurate and visually stunning.”
The Navier–Stokes equations, named after physicists Claude-Louis Navier and George Gabriel Stokes, describe the motion of viscous fluids, Batty said. “The physics of viscous fluids is fairly well understood, but the challenge for computer scientists is how best to discretize the equations — write them down in a way that they can be solved on a computer.”
The Navier–Stokes equations are continuous, meaning that there is an exact solution to them, he said. “However, some scenarios are sufficiently complicated that you can’t come up with a simple solution. Instead, you need to do numerical approximations. You take the continuous math and break it down into discrete chunks that you can store on a computer to solve — taking the real equations and coming up with algorithms that can solve them in an approximate way.”
Tar, honey, caramel and paint are some familiar viscous liquids that show an array of captivating behaviours when something is dropped into them or when they are poured or spilled — behaviours that range from an object slowly being engulfed by a goopy liquid to a thick fluid buckling or coiling like a rope.
Given that viscous liquids are common, the demand is strong for computer-animation tools that can reproduce their behaviour accurately for a variety of purposes and industries. Examples abound, from creating a life-like liquid creature in the latest computer-animated blockbuster to advertisements of cosmetic products where a thick lotion is decanted slowly into a container to TV commercials that show gooey caramel being poured onto a wafer.
Interestingly, the solution Batty and his students have developed that couple the pressure and viscosity forces go farther than capturing coiling behaviour. Because their model simulates viscous fluids more accurately they also preserve fine surface details in the liquid.
“This is a nice example where modelling the physics of liquids correctly yields a more visually realistic and beautiful effect,” Batty said.
Batty demonstrates this with a simulation of viscous “armadillos” — a common 3D model developed by researchers at Stanford to create and test computer animations — being piled up one on top of the other. Using the standard animation model, the liquid armadillos melt together and quickly lose their details. But with the viscosity–pressure coupling solution Batty’s team has developed, the fine details are preserved as one armadillo melts into the next.
“If surface smoothing is acceptable to the animator, the traditional decoupled method that my PhD supervisor Robert Bridson and I developed in 2008 can still be used,” Batty said. “But if you want realistic coiling effects, sharper surface details or greater physical fidelity, our new coupled method should be used.”
Elements of Batty’s research have been adopted by the visual effects industry and incorporated into commercial animation software, including Side Effects’ Houdini and Maya’s Bifröst. Given the beautiful and realistic viscous animations he has now created don’t be surprised if you see this latest animation effect in the next blockbuster.
For more information about this computer-animation research, see, “Variational Stokes: A Unified Pressure-Viscosity Solver for Accurate Viscous Liquids,” a paper authored by Egor Larionov, Christopher Batty and Robert Bridson, which was published in ACM Transactions on Graphics, volume 36, number 4, article 101.