10 expert tips for better Houdini FLIP fluid simulations
200320 Kevinpingahoudinifluidstips S.jpg

The current VFX role of FuseFX artist Kevin Pinga shows Houdini's ability to simulate real liquids like smoke and liquids. Follow his 10 production-proven hacks to create faster and more flexible FLIP fluid simulations.

Houdini offers a range of robust tools for the simulation of liquids. However, it is a particularly challenging task to make liquids look realistic, especially for broadcasting.

Since TV shows are now heavily dependent on visual effects, delivery times are getting shorter, but quality expectations are comparable to those for effects in feature films. The artist must exert pressure to ensure that a recording reaches the final before it is broadcast. In most cases there are only days (sometimes hours!).

In the past three years I have performed fluid simulation work for TV shows like The Walking Dead and Castle Rock in several studios, including Ingenuity Studios, FuseFX and Luma Pictures. I've also contributed FX work in music videos for artists like Taylor Swift, Billie Eilish and Maroon 5.

Through these projects, I've collected some hacks in my toolbox when it comes to simulating liquids with Houdini's FLIP solver. With these tips and tricks, you can manage your fluid simulations more efficiently if you try to deliver fluid intake on time while maintaining a high level of quality.

The tips are aimed at artists who are familiar with the FLIP solver. So when you start, try SideFX's own tutorials. The images in the article have been scaled down for the web, but you can download the originals here.

The procurement of liquids with POP Source offers known emission, activation and speed attributes.

1. Source liquids with POP source, not FLIP source

The standard method for obtaining fluids for FLIP is to use a FLIP source node, which essentially creates a VDB that is read into DOPs by the volume source node. You get this automatically when you use the shelf tools.

While this method works well if you source from a large, ambiguous form, it can be very resource intensive and time consuming. Increasing the resolution of your VDB to get more accurate and accurate sourcing can slow things down even before you even get into the simulation phase.

Instead, I like to use regular polygon-based SOP geometry directly without converting to VDBs. This source can be read in from the POP source node, which is connected to the sourcing input of the FLIP solver itself, just like you would import a source for a regular particle simulation.

The controls on the source POP node are also much more intuitive. Most artists should already know them through their time with regular particles. The number of particles can be controlled and monitored much more predictably, regardless of the particle separation of the FLIP object itself.

Adding a small amount of noise with a POP Force node contributes significantly to detailing FLIP simulations.

2. Use POP nodes with FLIP fluids

Something that young artists forget is that FLIP is essentially a series of POPs with some volumetric advection steps in between. However, the base itself consists only of particles, which means that all POP nodes in DOPs can be used for FLIP liquids! For this reason, we could use the POP source node in the previous tip.

The POP Force knot is a basic requirement for creating interesting movements when working with normal particles. So why not use it with FLIP fluids? Using it to introduce even a small amount of noise can produce a more pleasing fluid. Low frequency noise can also be useful to create details without having to increase particle count or particle separation. (Be careful not to add too much noise as this can make your simulation look unrealistic.)

Another POP node that is useful in FLIP simulations is the POP speed limit. In conjunction with a POP drag node, it is ideal for controlling particles at high speed that could otherwise get out of control.

Referencing the parameters in Bounds qL helps to set simulation limits.

3. Use Bounds qL to set your FLIP limits

The Bounds qL node is a very useful tool that contains many simple but useful functions. It is part of a larger open source Houdini toolset called qLib. Most studios install qLib by default because its development depends on real production work. If you don't have it in your personal production environment, you can easily install it by following the instructions on GitHub.

I mainly use Bounds qL to set my volume limits for FLIP and Pyro simulations. This is an advance over the standard Bound node because it includes an option to create boundaries based on an animated input.

The function I find most useful is the Output: Values ​​check box, which unlocks the values ​​for the size and center of the bounding box. These values ​​can then be copied to any parameter on the Volume Limits tab of the FLIP Solver or to other operations that require a bounding box. Centralized bounding box information avoids user errors and creates more procedural setups.

Activating additional FLIP attributes: As with many things in Houdini, the update is only a few check boxes away!

4. Activate useful attributes in the FLIP solver

There are some parameters on the FLIP solver that I want to activate in most of my FLIP sims. The three most important are ID, age and vorticity. They can be used to make optimizations after simulation, as we'll see in the next tip. You can find them all in the FLIP solver under the Behavior and Vorticity tabs, as shown above.

Most artists already know the ID attribute and know how powerful it can be. Your data size may need a small hit to cache an additional attribute. However, it is always a good idea to have this information available.

By activating the age attribute via the Age particle check box (which also exports the life attribute), you can control how a sim looks over time, especially if you have a source that is constantly emitting.

The vorticity attribute is useful for the procurement of secondary simulations such as white water and is ideal for manipulating the shading.

A simple VEX dispute to adjust particle size based on the density of the point cloud. Full size picture here.

5. After the simulation, make optimizations to save faulty Sims

As a result, there is a tendency to rely heavily on the output of a FLIP simulation. Although this is an ideal workflow due to time constraints, you don't always have the luxury of re-simulating to fix problems. In such cases, performing optimizations after the simulation on the FLIP particles themselves can help to "save" the Sim.

For example, one of the reasons for adding the ID attribute is that you can use the Retime node to reschedule a SIM. There were times when I forgot to check this box, only to find that the only note I received on the recording was "slow down 80%", which means that I had simulated everything again.

Another common problem when running medium resolution simulations is that the size of the liquid droplets is good in high density areas of the simulation, but too large in low density areas. In such cases, a simple argument with the pcfind: function can help mark sparse areas and lower their pscale value.

Here is the code snippet used in the wrangle:

int pc () = pcfind (0, & # 39; P & # 39 ;, @ P, chf (& # 39; max_dist & # 39;), chi (& # 39; max_pts & # 39;));
@pscale * = float (len (pc)) / ch (& # 39; max_pts & # 39;);

Use xyzdist () and primuv () to push particles towards the collision surface.

6. Use xyzdist to treat high-resolution collision areas

This is another post-simulation optimization, but I find xyzdist () so useful that it deserves its own point. Besides primuv (), it is by far one of my most used functions.

In a VEX or VOP context, xyzdist () calculates the distance to the next interpolated point on a surface. In combination with primuv () you can extract any attribute from the parametric UV rays of the object!

In the example above, the position of the high-resolution collision surface is extracted and used to push particles to the surface. In some cases, you can do this directly on the meshed surface itself, especially when taking pictures where the collision surface is transparent (e.g. when liquid is poured into a clear glass). Make sure you limit the distance to a really small value to speed up the calculations!

Here is the code snippet used in the wrangle:

// initialize variables
int p_prim;
Vector p_puv;
// Determine the distance and parametric position of the closest point
float dist = xyzdist (1, @ P, p_prim, p_puv);
Vector P2 = primuv (1, "P", p_prim, p_puv);
// Mixing the P of the points, influenced by a mapped distance
@P = fit (dist, chf ("min_dist"), chf ("max_dist"), P2, @ P);

In production, it would be more practical to use a lower resolution collider during simulation and then perform this function in a post-simulation wrangle so that the fluid looks as if it were interacting with a high resolution collider.

I would highly recommend reading Henry "toadstorm" Foster's blog post for a more detailed explanation of xyzdist () and primuv ().

An easy way to correctly blow off problematic particles using ID attributes.

7. Kill problematic particles with ID

This is a simple but effective trick if you have a simulation that is 98% almost final, but where the remaining 2% of the particles just don't work. Once you've saved the ID attribute mentioned in the previous tips, you can use it to blow up the problem particles. Without an ID, you couldn't mark the right particles for deletion because the score changes from frame to frame.

The best way to do this is to switch to point selection mode and press (9) on your number pad. The Group selection area is then opened. To select by ID, click the gear icon and choose Attributes> ID. Now you can simply select the particles you want to remove in the viewport and click on (Delete). An explosion node is generated automatically, which refers to the point ID instead of the point number.

Increase surface oversampling to fill sparse areas of a simulation.

8. Use the reseeding to spice up sparse regions

In production, most development work on simulations is carried out with a container of medium resolution. Sometimes you get a medium resolution FLIP sim that contains all the notes to be hit, but doesn't contain enough particles to make it look correct when crosslinked for final rendering. You lower your particle separation setting in the FLIP solver (which increases the resolution and particle count), send your simulation to the farm and go home to enjoy the rest of your weekend. The next morning you come back and discover the simulation now looks very different!

In such cases, I prefer increasing the reseeding parameters rather than changing my particle separation. By default, reseeding is already activated. However, if you activate the Surface oversampling parameter, you can increase the number of particles in sparsely populated areas by distributing the particles. In this way, you maintain the overall appearance of your simulation, but have enough particles to prevent the meshed liquid from looking like Swiss cheese.

Check out this superb video by Dave Stewart to see the workflow in action.

Render the original FLIP-Sim directly as white water.

9. Use the original FLIP-Sim directly as another element

One of my goals when working with fluid simulations is to maximize the use of the original FLIP simulation. This includes direct use as white water.

The traditional way to produce whitewater is to simulate the FLIP fluid and then run the Whitewater solver over it. However, the second step is not always necessary, especially with fast moving liquids like splashes and water jets (think of a broken hydrant or underwater in a whirlpool – and yes, these are pictures from real projects!) In addition, it can be quite difficult to make the liquid look right when the particles interlock.

Instead, you can take the FLIP-Sim yourself and render directly with a white water shader. You can either render the particles yourself or rasterize them into a VDB and render the result as a volume. I use a mixture of the two techniques, depending on what looks best for a shot. The whitewater shader, which is created automatically when using Houdini's ocean tools, is very suitable for rasterized particles.

Use the Delay Load Geometry check box in the File Cache node to speed up work on high-resolution Sims.

10. Optimize the sim and caches

One of the challenges with high-resolution FLIP sims is dealing with the large amounts of data they generate. It is common to delete all attributes that you do not need before you cache part of a simulation.

Another way to reduce your storage needs is to remove the particles outside of the camera's frustration. There are many ways to do this in Houdini. So use your preferred method.

If you have a geometry that is ready for rendering, it is advisable to save it and activate the checkbox "Load geometry delay". Instead of having the mantra embed the geometry in the IFD file, the file on the hard disk is referenced instead. This will help reduce load times and dramatically reduce both IFD generation times and file size. Useful if you have a render farm and don't want to block it!

About the author: Kevin Pinga is a Los Angeles-based FX artist who has worked on award-winning films and TV series like Spider-Man: Far from Home, which recently won the AACTA Award for Best Visual Effects. Other projects include AMC's The Walking Dead, Brooklyn Nine-Nine, and music videos for Taylor Swift and Billie Eilish. Visit the Kevin website.

Tags: 10 hacks for better Houdini FLIP fluid simulations, attributes, bound nodes, boundaries qL, collider, collision area, deceleration load geometry, detail simulation, DOP, expert advice, faster simulation workflow, solving simulation problems, FLIP solver, FLIP. Liquid, liquid simulation, truncated cone culling, FuseFX, hacks, Houdini, IDF file, Ingenuity Studios, Kevin Pinga, killing particles by ID, Luma Pictures, mantra, more flexible simulation workflow, output values, parameters, particle age, particle ID, particle networking , Particle separation, particle simulation, PCFIND, POP source, POP source, POP speed limit, optimization after simulation, production workflow, pscale, qLib, reseeding, resimulation, retiming simulation, scripting, simulation, SOP, surface oversampling, tips, tutorial, Upsing simulation, VDB, VEX, VFX, visual effects, volume, volume limitation, volumetric rendering, vorticity, white water, white water shader, white water solver, wrangle, xyzdist (). primuv ()


Please enter your comment!
Please enter your name here