Many times I get asked how can you resize a fluid container? Every time I answer this question I invariably come up with yet a new method. Goes to show you how flexible this amazing piece of software is.
I wanted to come up with a solution that had no real performance penalty and also follows my desire to do as much as possible in SOPs around any DOP simulation. If it is from the shelf, even better. This is exactly what I did for an audience on a recent trip and as usual, it was live, and with luck and only one typo, got it to go first try.
The "Resize Fluid" shelf tool is the first step I take in resizing any fluid container and this example is no different. In this example, I create a simple object that is used to resize the fluid container and make sure it is created before I execute the shelf tool.
Once the Resize Fluid tool is done, you can now freely control the size of the fluid container by animating the object and the geometry contained inside that object. Fetch the density field, scatter points and put a Bounds SOP on that and you are done.
Well, almost. I also like to wrap in velocity and in this case it is trivial to do. I fetch the velocity fields from the sim and in a simple VOP SOP, I project the points by the velocity fields properly compensated for the frame rate of course as we are solving per frame and not per second. Velocity is in Houdini units per second so you need to always divide by the frame rate to get the proper velocity values. By taking velocity in to account, if there is an area of high velocity, I can make sure that the container will be able to capture this and size accordingly.
One final thing on resizing fluid containers. I am a big believer in having a rich velocity field enveloping my simulation. I am willing to give back a bit of performance and consume the memory to do so. I do believe that you need to have considerable velocity surrounding the fluid that you are advecting by the velocity. In fast evolving and noisy containers, by watching the velocity fields and the sim results, over time you can see what I mean.
Keep the pedal to the metal,
|