About a week ago, I posted a quick video of some early results for a 2D fluid simulation I quickly coded up.

Once I got the 2D simulation working the way I wanted, it was only a matter of about a day’s coding to convert the code to simulate 3D fluid dynamics.

But one idea I had going from 2D to 3D was to use the 2D simulator to tweak the physics parameters until I like them, and then run the 3D simulation. If this works, it could be quite cool because the 2D simulations are basically realtime, while the 3D simulator is a few hundred times slower.

So I tried it out, and it worked better than I had expected. Here is a render:
(YouTube added a whole bunch of compression artifacts… but you get the idea. It is only a rough particle test render to begin with.)

I worked on my laptop over the weekend to do this, but here a few timing numbers to give you an idea of why you might want to do as much tweaking as possible in 2D before doing a 3D simulation:

  • The 2D simulation took about 30 seconds for 20 seconds of simulation.
  • The 3D simulation took about 2 hours to do 20 seconds of simulation.
  • The workstations at the office should be between 2x and 4x faster than my laptop.
The next few things I want to try are:
  • Rather than rendering the particles as small spheres, render them as metaballs to give them a more natural shape and smoother water surface.
  • Export the particles to Houdini or Maya for photo-real rendering.
  • Break up the simulation across several workstations to get a simulation cluster to speed things up another order of magnitude. (A 10x speedup across a dozen or so workstations seems reasonably achievable. Beyond that and the network speeds might become a bottleneck.)