Houdini 21.0 Heightfields and terrains

Shallow Water Solver: Outputs

Save and convert shallow water simulations.

On this page

On the previous pages, it was mentioned several times that the results of the solver are available as layers, for example water, vel.* or force. In many cases you will use the layers directly for texturing and rendering. In this context, the layers will again act as masks to spare out certain areas and reveal underlying structures. You can read more on the Texture basics and Texture layers pages of this guide.

Conversion

If you convert your heightfields to polygons and points, all layer information will be automatically translated into appropriate point attributes. The node for this process is the Convert Heightfield SOP and you must add it downstream of the Shallow Water Solver SOP.

Caching

When you start a simulation, the result will be cached to the computer’s RAM. With large high-resolution heightfields, the default cache of 5000 MB is normally not enough to cache more than 150-200 frames. On the solver’s Simulation tab you can adjust the allocated memory with Cache Memory (MB).

If you want to cache a simulation to disk, you can add a File Cache SOP. This node lets you assemble a file path and adjust a frame range. Versioning is also supported. Please read the File Cache SOP’s help page for more information on the parameters.

Once you've made your settings, you can press one of the Save to … buttons to write a sequence of files to the specified directory. Make sure that Caching ▸ Sequence ▸ Simulation is turned on! When you turn on Load from Disk, you can replay the simulation in Houdini.

Geometry extraction

If you only need the geometry of the water surface, you can do that with a single Blast SOP from the converted heightfield.

  • Add the Blast SOP and connect its input to the output of the convert node.

  • Set Group Type to Points.

  • On the Group parameter, enter @water==0.

The node will now delete all points with a water value that is not 0 and you’ll get the water surface with UV coordinates. If you don’t want to delete any points, but store the water points in a group, you can do that with the same expression.

  • Instead of a Blast SOP, lay down a Group SOP and connect it.

  • For Group Name enter water.

  • On the Base Group section, go to Base Group and enter @water>0.

Both methods also work with any other layer like vel_x, accel_z or vorticity. Note that you have to turn on the acceleration and vorticity layers on the solver before you can turn them into groups or delete them.

Heightfields and terrains

Creation

Scattering

Masking

  • Masking

    Define zones of interest and detail.

  • Light masks

    Create masks from the sunlit areas on a terrain.

Natural effects

  • Erosion

    Turn mountains into dust.

  • Slump

    When mountains crumble to rocks.

  • Flow fields

    Let it flow (down the mountain).

VEX

Texturing

Shallow Water Solver