This blog post discusses a technique for rendering SideFX Houdini FLIP fluids as sparse fields of wormlike particles (hence my slightly over-the-top Sparse Vermiform moniker) with their color based on the fluid system's gas pressure field.

The project begins with an oblate spheroid that is converted to a FLIP Fluid using the FLIP Fluid from Object shelf tool. The fluid object sits within a box that's converted to a static body with its volume inverted to act as a container.

To introduce a wave-like motion to the fluid, I decided to animate gravity by adding an expression to the z channel of the default gravity node: sin($F * 2) * 3.333.

Now for the magic (that probably everybody knew apart from me!): delving into FLIP fluid object's FLIP Configure Object, you can find a series of vector and scalar field nodes for different fields such as velocity, mass density, divergence and pressure. Passing the gas pressure field to each particle is easy as adding a Gas Field to Particle node to the DOP network and plugging it into the FLIP Solver:


I set both the attribute and source field to pressure - now, each particle now has an @pressure attribute that corresponds to the local gas pressure in the FLIP fluid. Although I'm using this attribute to set the particle color, it could be used for many other effects, such as making viscosity or temperature a function of pressure.

Moving onto rendering, I trashed the automatically created nodes for creating a fluid surface and created my own geometry node containing:


The sparsity is introduced with a Delete node that culls points based on their @ptnum attribute using "delete by expression": (@ptnum % 75) != 0.

Now that each point has a @pressure, the Attribute Wrangle node uses that to generate an RGB color from a hue based on pressure and populate the @Cd attribute:

    float hue = smooth(0, 1, abs(sin(@pressure * 0.1)));
    @Cd = hsvtorgb(hue, 1, 1);

The Trail node with a "connect as polygons" result type plugged into a Wireframe node yields the little worms. 

Voila! 



3

View comments

  1. Its quite different blog from others and such a interesting explanation with the help of PPT clip. We provide a great offers ACCURATE COMMODITY TIPS , Commodity Tips Free Trial and SURE COMMODITY TIPS.

    ReplyDelete
  2. On Facebook, people daily updates their amd-ryzen-5-3400g-3-7ghz status according to their emotions and they also used to uplood new photos on Facebook. For giving feedback, on their post, we always use comment section. For your special ones, you need stylish and long comments, which you can get from this article.

    ReplyDelete
  3. Are you Worried to Know Hikvision DS-D5022FN 21.5 Inch Monitor Price in Bangladesh? let’s Discuss the Price of Hikvision DS-D5022FN 21.5 Inch Monitor is… [Read more]

    ReplyDelete
About Me
About Me
Labels
Labels
Blog Archive
Loading