Procedural Foliage Scattering



The procedural scattering tools allow environment artists to rapidly lay out large areas of Foliage for any given landscape in Unreal. The tools are a set of Houdini Digital Assets, so the Houdini Engine is required, within Unreal, for this pipeline to work. The following outlines the proper usage of the HDA’s and the steps needed to get the system up and running.

Before beginning it is recommended to create a folder called “HDA” in the Scene Outliner, so you can keep all the Houdini Engine related assets together.

Process the Landscape to a Mesh

The first step in this process is to turn the landscape in which you want to scatter foliage onto, turned into a mesh. To do this we need to use the wc_process_heightfield.hda This is located under Game/HDA/Procedural_Foliage folder in the Game Editor. Simply drag this HDA into the scene you want to work with. As a good practice it is recommended to 0 out the world space transform for the asset.


In order to process the Landscape into a mesh we need to set the landscape, we want to convert, in the Inputs tab of the HDA. You can find this in the Details panel for the HDA. Set the dropdown to the “Landscape Input” option. This will allow us to select the landscape we want top convert easily. Select the landscape. The HDA will automatically begin the conversion process. This can take anywhere from a few seconds to a few minutes depending on the “Grid Spacing” value set in the “Resample” Tab. A higher value will take less time but will be less accurate. A smaller value will take more time but be more accurate. The default is 10 and has been working well for most islands that were tested. If you find that you are getting a lot of floating foliage, it is recommended to reduced the Grid Spacing value and re-bake.


When the process heightfield HDA is completed you will see something similar to the image below.


With the Landscape converted to a mesh. We should bake it so we don’t accidently trigger the HDA to cook again. You can keep the wc_process_heightfield in the scene if you would like. From here all we need to do is bake the mesh to a static mesh. To do this we simply need to hit the “Bake To Actors” button found in the “Houdini Assets” fold out. When you run this command, it will take the live Houdini Mesh and convert it to a regular mesh that we will use to snap foliage to.


That concludes the setup of the snap mesh we need in order to snap our foliage to. You are completely welcome to keep the original HDA around if you need to re-bake the landscape, or you can delete it and just keep the bake out mesh. It is also possible to import a mesh from another source, if you would like to reduce the mesh in another DCC package.

At this point, you can hide the snap mesh so it doesn’t get in the way of your foliage work. Once the generated foliage is created, or the entire island has been covered in foliage, you can delete this snap mesh if you so choose. It is definitely recommended to keep it around if you need to re-generate the scatter results.

Create a Scatter Region

The Scatter region is the start of all scattering of foliage. It is called “wc_scatter_region”. This HDA, will create a starter curve for you to edit. To edit the curve simply click on the individual points and hit “W” on the keyboard to reveal the transform gizmo. Use the transform gizmo to move a point around in world space. To select more than on point on the curve, hold down the “CTRL” key and select the points you wish to move. If you want to add more points to the curve then select a point on the curve and hold down the “ALT” key. Then drag out the new point.


The idea behind the Scatter Region is to allow us to keep the original scatter curve and points around so we don’t lose our placement work. Every individual HDA after this step will simple instance the type of meshes they are responsible for and allow us to modify their properties. You’ll notice that the Scatter region comes with small gizmos so you can see if the points within the scatter region are being snapped. This is simply a debug display type of utility and can be turned off in the Gizmos tab of the HDA.

To get the Gizmos and Points of the Scatter region to snap to the landscape we need to assign the Snap mesh to the Scatter Region HDA. To do this we need to switch the Terrain Input for the HDA over to “World Outliner Input”. With that selected we need to do the assignment of the snap mesh. To do this, hit the “Start Selection (Lock Details Panel)” button once. This will lock the details panel from selecting anything else and wait for you to hit the button once more. Once hit for the first time, select the baked out landscape mesh from the “Scene Outliner”, then come back to the scatter region’s details, and hit the “Start Selection (Lock Details Panel)” again. If done correctly you will see the little gizmos, in the scatter region, snapped to the landscape.


From within the Scatter Region Houdini Parameters, you will notice a “Scatter” tab. This is where you will define the amount of points you want to scatter for each region. Rocks, Trees, and Low Level Vegetation points are controlled here. You can also adjust the spacing between each of the scatter points so you can achieve more clumping or to space out each point evenly.


The “Scale Radii” is the slider you are looking for to adjust clumping or to get the points to be spaced evenly from each other.

Always remember that if you need more points for a specific region, you will have to come back to the scatter region to change the amount of scatter points per type of foliage.

Create a Rock Region

The Rock region is dedicated to scattering rocks and rocks only. The Reason behind this is that we want to keep track of where all the scattered rocks are, so we can use that data later on, as obstacles for the trees and low level foliage.

To get started with the Rock Region simply drag out the “wc_rock_region” HDA into the scene, ideally close the region that it is associate with. It doesn’t matter where you put it in the scene, but for organizational purposes it is recommended to put it inside the scatter region that will drive the rock region. Once placed the HDA will not look like it did anything. This is because it needs a “Scatter Region” assigned to it. All of the following HDA’s need a scatter region in order for it to work. The scatter region contains the points necessary to instance rocks.


To assign the scatter region make sure you are in the “Input” tab of the rock region. Then change the dropdown to “Asset Input”. this will allow us to assign other HDA’s to this HDA. Hence allowing us to pass the points from the scatter region to the rock region. Once you switch the dropdown to “Asset Input”, you’ll get a list of regions that are currently in the scene. Select the region you wish to associate to this region and select it. Once done you will see rocks being instantiated into the region.


These Rocks can be changed in a couple of ways. You can select from a preset in the dropdown called Biome Type, or you can replace the instanced mesh directly in the “Houdini Instanced Inputs” foldout. This foldout exposes the current set of static meshes being used by the HDA. The Biome Type dropdown includes built in static meshes that are commonly used in the individual biomes.


Each of the HDA’s in this system uses the same convention for the instance meshes. Meaning each HDA has the same “Biome Type” dropdown and the “Houdini Instance Inputs” foldout. If ever you need to add a specific static mesh to one of the Biome Types, just let Kenny know and he’ll add it to the system.

All of the Foliage regions have almost the same parameters so we will begin with the Rocks Region and walk through each of the individual tabs.

Slope Tab

The slope tab is where you can adjust the slope for the entire region. A value of 0 means that rocks will only be placed on extremely flat areas. A value of 1 means the region will ignore the slope. The current value is in radians meaning 1 == 90 degrees. If you set a value of 0.5 rocks will only be placed at a slope of 45 degrees or less.


Height Tab

The Height tab allows you to adjust at which heights a certain foliage can be scattered at. There is a min height and a max height slider. By default the min height slider is set to -10 or just below sea level. The max Height is set to 1000 by default which allows foliage to grow at most heights. Simply adjust the sliders to the height you like. It is recommended to start with the min height since the max height is already well above most landscape heights.


Scale Tab

The scale tab allows you to control the min and max scale of all the scattered instanced meshes. The min scale is the minimum possible scale an instanced mesh can be. This is based off of the original scale of the object. The maximum scale is the max scale any object can be and is based off of the original scale of the static mesh. Finally the global scale allows you to add scale across the board to each object.


Rotation Tab

The rotation tab allows you to manage the minimum and maximum rotation angle for each instanced mesh. By default the Min Max Angle is set to 35. Simply adjust this slider to change the random rotation about the z axis of the object. This means that all scattered objects will get a random rotation between -35 degrees and 35 degrees. The Min Max X angle allows you to add some random rotation to the other axes for the mesh. Most of the time the main axis is fine, but these other sliders allow you to tweak as much as possible.


Z Offset Tab

Here you can set how much z offset you’d like to give to the scattered meshes. Positive values raises the mesh and negative values lower the mesh.


Alignment Tab

The alignment tab allows you to align to the normal of the landscape or not. If this toggle is turned off then the alignment will be flat to the world.


That concludes the information on what is contained in each tab of the Rock Region HDA. Each of the following HDA’s have exactly the same parameters and work in the exact same way. Only features custom to each HDA will be covered from here on out.

Create a Tree Region


The Tree region is dedicated to scattering trees and trees only. The Reason for this is to keep track of where trees are in the scatter region. We will use this data later on when we create the low level foliage region, so as to keep the low level foliage from growing inside a tree.

Obstacles Tab

In the Tree Region HDA you have the option to assign a rock Obstacle object or HDA. This can be used to pass the Rock Region into the Tree region so you don’t get trees growing inside of rocks. Switch the Obstacles input over to an “Asset Input” to assign the rock HDA to it. Once assigned you can use the Min Obstacle Distance to make sure Trees only grow a certain distance from rocks and not inside of them.


Create a Low Level Vegetation Region


The low level vegetation region is meant for scattering things like ferns and larger plants but not clutter foliage. The name of the HDA is “wc_lowvegetation_region”. The only different input parameter that is included with this HDA is the Tree Obstacle found underneath the Obstacles Tab. Just like the rock obstacles for the tree region the tree obstacle ensures that no vegetation can grow inside of a tree. If you don’t assign a Tree region to this input the Low Level Veg region will just ignore iut and you might get vegetation growing inside of trees.

Convert Scatter Foliage to Unreal Foliage

Once you are happy with the results from the scattering process, it is now time to convert all the work to Unreal foliage so it can be edited with the Foliage painter within Unreal. To do this, simply open the command line using the “~” key on the keyboard and type in “meshestofoliage”. This will convert the HISM meshes to foliage meshes. If a Foliage Actor does not exist already in the scene then one will be created. Once completed, you can now use the foliage brush to further refine the foliage placement.