The secrets of CGI fluid simulations

CGI fluid simulations have become an essential part of audiovisual productions. They can take different forms: water, fire, smoke, lava, etc. But creating them realistically is a highly complex challenge that relies on a mastery of simulation software and algorithms. So how do studios go about creating realistic fluid simulations? That's what we're going to find out in this article!

The art of controlling the uncontrollable

Let's start by defining what a fluid simulation is. In practical terms, a fluid simulation - which can be water, fire, smoke, etc. - is the result of a 3D calculation based on an algorithm. - is the result of a 3D calculation based on an algorithm. It will never be as precise as a 'tangible' object (house, character, car, etc.), because a simulation is intangible. Yes, because as Bem says in Harry Potter and the Prisoner of Azkaban, "It's like trying to catch smoke. Trying to catch smoke with your hands". It's not possible. A 'tangible' object is made by hand, it is worked on and is precise, unlike a 'non-tangible' object which is not defined by hand, but is the result of a more or less chaotic calculation.

The physics of fluids in CGI

Let's now tackle the second part of our question: how is a simulation made? We need a transmitter, which can take several forms, and emit a variety of information: fire, smoke, water, velocity, pressure, temperature, etc., and a simulator (or simulation zone). Today's simulators are based on voxels (like pixels in 3D: small cubes containing dynamic information) and are limited to a precise zone in which the simulation evolves. Numerous parameters can be set, such as :

  • The speed of the simulation,
  • Voxel size,
  • The scale of the simulation,
  • The algorithm used,
  • The sub-sampling…

And many other dynamic parameters directly linked to the behaviour of the fluid, such as dissipation, inertia, cooling, etc.

The number of voxels and their numbers directly affect the quality of a simulation: you can quickly end up with millions of voxels to manage and a simulation that is very complex to calculate.

Once you've set up your simulation, all you have to do is run it and see how it develops!

The fundamental concept is temporality. Without it, the simulation cannot be created. A waterfall doesn't just appear out of nowhere; you have to define its source and the environment with which the water will interact. We define an initial situation and let the algorithm calculate and simulate its movement/behaviour.

💡 Petit point technique, pour concevoir des simulations de fluides, il est nécessaire d’utiliser des équations complexes exprimant les mouvements des liquides et des gaz. L’un des modèles les plus couramment utilisés est celui des équations de Navier-Stokes. Ces équations de Navier-Stokes permettent de prédire l’évolution d’un fluide en fonction de la pression, de la vitesse et des forces appliquées.

Now let's take a look at the various challenges and possible technical optimisations for your simulation.

Technical challenges and optimisation

As you will have realised by now, creating realistic 3D fluids is a real challenge because of a number of constraints:

  • Simulation scale: a small or large stage will not be managed in the same way, and may require specific tools... Or you may need to be clever!
  • High computation time: a detailed simulation can take several hours to render (or even several days!)
  • Simulation stability: avoid digital artefacts or unnatural behaviour,
  • Realistic simulation: that your simulation is a credible and realistic dynamic (behaviour of wet sand, snow, etc.).

The future of fluid simulations in CGI

With advances in technology, simulations are becoming faster and more accessible. Artificial intelligence and machine learning can speed up calculations by predicting fluid behaviour from existing simulations. In addition, real-time engines such as Unreal Engine 5 now incorporate interactive fluid simulation tools, opening the door to ever more immersive rendering.

CGI fluid simulations are a fascinating blend of science and art. Thanks to constant advances in computer graphics, fluid effects are becoming increasingly impressive, whether in films, video games or real-time applications. Mastering these techniques means pushing back the boundaries of realism and delivering ever more spectacular visuals.