Houdini 21.0 Heightfields and terrains

Flow fields

Let it flow (down the mountain).

Flow fields are available with the Heightfield Erode SOP, HeightField Slump SOP, but also a separate HeightField Flow Field SOP. You can, for example, use the fields as distortion layers for the HeightField Distort by Layer SOP. Another field of application for the layers is masking. Or you can use the fields for scattering rocks, trees, and other landscape elements. Flow fields are interesting for all kinds of erosion where material is removed and transported.

When you calculate a flow field, you’ll get two layers: flow and flowdir. The first layer represents the cumulative material flow in voxel space. The second layer shows the average direction of flow at each voxel. The flowdir layer doesn’t contain any height information. The image below shows the flow layer (white) of an erosion node.

Example: Erosion channels

The following example illustrates how to use a flow field to create deep erosion channels through distortion.

Note

All explanations and examples use a very basic terrain, consisting of a HeightField SOP and a HeightField Noise SOP to get some mountains and rocky structures. To get enough detail, set the heightfield node’s Grid Spacing to 1.

For more information on how to work with this fundamental setup, please read the Generating a heightfield from scratch introduction.

  1. On the HeightField Noise SOP, turn off Center Noise, because you’ll be using a Worley noise for the terrain that already comes with a vertical offset.

  2. Set Amplitude to 400. This will slightly decrease the height of the mountains.

  3. Go to the Noise Settings section. From the Noise Type dropdown menu, choose Worley Cellular F1. You will now see a mountain range with sharp peaks and ridges.

  4. Lay down a HeightField Distort by Noise SOP and connect its first input with the output of the noise node. This node breaks up the regular fractal and creates small rocky structures.

  5. To get more detail, change Element Size to 75.

Flow

Here, you’ll be creating the flow field that will later control the amount of erosion. You can consider the HeightField Flow Field SOP a modified HeightField Slump SOP. This node simulates how debris and lose material behaves when it’s sliding down a hill and there’s a separate chapter about this node.

  1. Lay down a HeightField Flow Field SOP and connect its input with the output of the distort node. After a couple of moments you’ll see a red mask.

  2. Go to the Flow tab and change Slump Mode to Smooth. With this mode, the water spreads out in every possible direction.

  3. Change Rain Amount to 0.4 to simulate stronger precipitation. The mask now becomes slightly denser, because there’s an increased probability for raindrops to cover larger areas of the terrain. With Rain Density you can also simulate different types of rain form normal to intense.

Flow layers

As mentioned in the introduction, the flow field nodes creates several layers that represent how water spreads over the terrain, but there’s also a water layer itself. The water layer is directly affected by the node’s Rain Amount and Rain Density and where the water collects in the terrain.

You can use a HeightField Visualize SOP to make the flow field layers visible. Just use the visualize node’s Layer parameters and apply a Color. The image shows the flow field node’s layers: flowdir.x, water, flow and flowdir.z.

Distortion

In this step you’ll use the flow layer to scale the displacement of the terrain to control the size and depth of erosion channels.

  1. Add a HeightField Distort by Layer SOP and connect both inputs with the output of the flow field node. The second input makes the existing layers available to all relevant parameters.

  2. Open the Scale Field parameter’s dropdown and choose flow. This field will be used to displace the terrain inside the masked area.

  3. Set Displace Scale to 2 to create deeper and more pronounced channels.

If you still think the channels are too deep or show tiny spikes, you can add a HeightField Blur SOP after the distortion node. Set Radius to 0.5 or 1 to keep as much detail as possible.

And to get rid of the mask, terminate the network with a HeightField Mask Clear SOP. The default entry for Layer 1 is already mask, so you don’t have to change anything. Then turn on the node’s blue Display/Render flag to see the final result.

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