Monday, February 2, 2015

Match Flame Simulation

Problem: The speed of the animation of the match in this shot proved to be troublesome when simulating the flame. As is evident from the playblast below, the reaction that Andre has while holding the match causes the match to shake violently. This caused the fuel source to completely leave the area of the temperature field where the fuel was hot enough to burn in the space of a single frame. So, instead of remaining ignited, the fuel needed to heat up all over again in order to re-ignite. As this left a significant number of key frames without the match lit, the default simulation was not acceptable.



Solution: So, somehow I needed to transfer the heat  from the temperature field in the previous frame to the fuel in the current frame, so that it could remain ignited without any breaks. What I came up with was a simulation that would automatically generate "smear frames" for the fuel field in each frame. These smear frames connect each of the frames of animation on the match head, allowing the heat from the temperature to have a path to travel along from frame to frame.

Breakdown:

Initial Geometry

Step 1: Isolate Fuel Source
Step 1: Starting with the initial Geometry, the first step was to isolate the match head as the source of the flame, which I accomplished with a simple Group SOP.

Step 2: Backwards Trace with Trail SOP
Step 2: With the source isolated, I converted the source down to the center point each frame using a Fuse SOP and deleting all but the first point. With only a single point defined in each frame, I used the Trail SOP to perform a backward trace to the previous frame.

Step 3: Generate volume from points 
Step 3: With the backward trace successfully established, the next step was to generate a volume in the place of the points on the line. Most of the time the points defined along the line were too sparse to generate the intended volume, so I used the Resample SOP to define a minimum distance between each point on the line. From there, I generated a Fuel field and Temperature field as VDB volume and then merged them together as a Houdini Fog Volume for compatibility with the Pyro Solver.

Step 4: Use as Source in Pyro Solver
Overlaid with Initial Geometry 
Step 4: With this volume set up to generate every frame, it was a trivial matter to set the volume as the source of the Pyro Solver and integrate the simulation with the rest of the scene!

Final Scene