falling rain droplets

(Incomplete) This page provides a technical breakdown of an animation sequence of rain drops hitting a hard surface.

 

One: Introduction
Two: Raindrop Simulation

Three: Exporting and Scripting
Four: Shading and Raytracing

 

introduction

The object of this project is to create a realistically simulated and rendered animation of a water droplet as if shot from a high-speed camera. This is probably one of our biggest projects yet as it entails not only a significant step in advanced shader writing, with the inclusion of real raytraced reflections and refractions, but also challenges us to devise a method of effectively simulating the actual drop with Maya particles.

After we've got a working particle simulation we then need to convert our particles into PRMan blobby objects. This can be done a number of ways, but the route I've taken as can be seen below, is to create a MEL script which will read the particle data and then spit out a rib file for each frame of the animation.

In order to achieve what we're going for here, we need accurate reference. Our class decided to make use of the brand new Panasonic HVX-200's to shoot some high speed footage of droplets from different liquids. The HVX can only shoot up to 60 frames a second, so the footage isn't dramatically slowed down, but enough to get a good idea of the process.

 

raindrop simulation

 

It was no secret that I wanted to use RealFlow right from the get-go. Why wouldn't I? There is simply no simulation I could put together in Maya that would come anything close to what could be done in 10 minutes with RealFlow.

Outside of playing with the demo for about a half hour, I didn't have a lot of experience with RealFlow. Fortunately, the fluid dynamics gods were smiling on me that week, and a copy of 3DWorld magazine had a tutorial on creating at a realistic water droplet in RealFlow. Seriously.

The catch was that I was unable to use the meshing function built into RealFlow to construct my actual drop. One of the objectives was to use Renderman Blobbies to build the mesh. This was both a strength and a weakness. Blobbies, while being the nicest, smoothest, most beautiful metaballs I've ever seen, were primarily spherical. This means I would have to devise a solution for morphing the geometry depending on the simulation. One solution I plan to test is to use the velocity vectors of the particles to determine blobby scale. On the upside, I save a ton of disk space considering I only have to export the particles from RealFlow, and because I won't be working with particles after the conversion to Blobbies and thus won't need the RealFlow plugins, I will be able to render the animation on the Render Farm.

The tutorial from 3DWorld was extremely easy to follow, and was easy to remember how to recreate from memory later that week in class.

 


 

1) - To start, we create a sphere emitter to generate our raindrop. The "fill" command will create a ball of particles in the sphere rather than spilling particles out like a normal emitter. This will react to daemons added later.
2) - Added next was a fill object emitter and a cube object. The cube object serves as a container for the fill object emitter, which creates a shallow puddle for the raindrop to collide with.
3) - Last, but not least, was simply adding the gravity daemon so that all this can work together. We run the simulation and then we have our animation, ready for export to Maya. Thats really it.

 

 

exporting and scripting

 

To export our little raindrop wonder, we go to Export Central in RealFlow.

As I said earlier, all we really need are the particles, so just about everything else can be turned off. One of the things I really like about RealFlow is the ability to export each fluid object as its own animation. So for this export, we'll get a series of RealFlow .bin files for both the fill object emitter and the raindrop itself.

Then we use the RealFlowParticles plugin for Maya to import our simulation. There seems to be some weird bug where the particles will phase out of existence periodically on playback, but they always seem to come back. This is sort of a moot point anyway, as it wasn't a really major hurdle. The next big step was to get these particles into rib files as blobbies.

There could be a thousand and one other methods of doing this, but this is the method I set out on. The plan is to create a mel script that will read the XYZ of each particle, and then output it into a self-generated rib file. The procedure to build the rib file is working as planned and at the time of this writing, the interface is now in development. This is still in progress as of 2-10-07.

 

shading and raytracing

Ultimately, due to time restraints and simply not knowing what to do about the shading, I hacked together some simple reflect and refracting code to add into the water droplet ribs. The final animation looking as such: