1 | Introduction

Foliage and scattering has always been a challenge for gamedev, especially when you are an Indie Gamedev.  PDG and Houdini gives us the power to handle this with ease.  Throughout this section we are going to look at how to set up an HDA to scatter points that contain paths to foliage prefabs in Unity.  We will then get it hooked up into our TOP network so the scattering of foliage is produced for us.

2 | File and Gather Foliage Prefabs

To kick off this section, we need to figure out a way to find all the prefabs that are of type foliage in our Unity project.  We also need to make our TOP network flexible enough so that it can be used in any Unity project as well as scale when new foliage prefabs are added.  This lecture will get us started with that task.

3 | Writing Foliage Paths to Csv

PDG and TOPs allow us to save out data in many different ways which provides us a ton of flexibility.  Let’s take a look at one of the ways in which we can save out all the paths to our prefabs to a CSV file.

4 | Creating The Scatter HDA – PART 1

Let’s start our Scatter HDA by getting the basic tool setup hooked into our TOP network.  We will also get a few items setup in the HDA’s Type Properties.

5 | Creating The Scatter HDA – PART 2

With our HDA all set up and ready to go let's fill in the guts of the scattering functionality.  We will learn how to create some effective heightfield masks as well as how to scatter points onto the terrain in a more intelligent way.

6 | Creating The Scatter HDA – PART 3

With our points in place and our CSV file containing the paths to the prefabs we want to instantiate onto the points, let’s take a look at how we place a single path on each one of the points.  This will give us the ability to attach a certain type of foliage to a certain type of point in our scatter points.

7 | Creating The Scatter HDA – PART 4

Let’s finish up our Scatter HDA and get some VEX code in place to handle the data on the points, so we are instantiating foliage in Unity.

8 | Test The Foliage Scatter In Unity

With our scattering HDA complete, lets promote some parameters to the HDA and give it a test inside Unity using the Houdini Engine!

9 | Review

Whew!  That was a ton of stuff to cover!  Let’s do a quick review to keep the info fresh in our minds.



For over thirty years, SideFX has been providing artists with procedural 3D animation and visual effects tools designed to create the highest-quality cinematic results. We are passionate about what our customers do because our roots are in production, both as artists and as pioneering technical innovators.

More from SideFX


  • 3clipse 1 year, 1 month ago  | 

    Great tutorial... unfortunately cannot get the scatter nodes to cook... tried debuggin and it gave me a cygwin\prism error... not sure where to go from that or why I am getting it as i didn't have Prism installed...

    • shoria 1 year ago  | 


      How did you fixed the problem because I have the same problem with the cygwin\prism error. Thank you.

    • shoria 1 year ago  | 

      failure at c:\cygwin\home\prisms\builder-new\nightly17.5.173cmake\dev\src\houdini\custom\pdg\hdaprocessor\hdaprocessor.c:872

  • 3clipse 1 year, 1 month ago  | 

    Oh everything cooks fine in Houdini but fails in Unity

    • wtrebella 1 year, 1 month ago  | 

      Looks like I'm also getting this problem. Everything cooks fine in Houdini but in Unity the terrain_scatter node fails. I've tried debugging it by opening up the version from Unity, but that one fails at project_terrain, which is weird. It seems like it might have something to do with the Table Import node?

      • wtrebella 1 year, 1 month ago  | 

        I figured out the problem. For some reason in Unity the path to the csv file has to be relative to the Assets folder. I'm not sure why, and maybe Kenny could enlighten us, or explain a better way to do this. But for now, I dropped the foliage.csv file into my Assets folder and pointed the file there (instead of the absolute path where the csv was located in the Houdini project folder). It then worked!

        • 2523279049 1 year ago  | 

          I also have this problem, but it has not been resolved.
          Always complaining about such an error:
          Getting Instance Transforms : Invalid argument given: Geometry is not an instancer.
          If session is invalid, try restarting Unity.

          • Higashibashi 11 months, 2 weeks ago  | 

            Same issue here. Tried moving the csv to the assets and repointing but still cook failed on the scatter. Not sure where to go.

  • wtrebella 1 year, 1 month ago  | 

    I've been following this tutorial series and they're wonderful. Only problem is that none of the assets are available for download (textures for terrain, prefabs for foliage, etc.) I can't find them in any of the project material zips. Am I missing something?


    • 3clipse 1 year, 1 month ago  | 

      They aren't supplied... a simple google search will get you some .tgas and some .prefabs... (there are enough just on the unity store)... they are good enough to get through the tutorials.

  • deroomaarten 1 year ago  | 

    When I re-open my project, the whole Geometry file goes wrong and has problems with finding and updating the `@pdg_output`.
    Does someone know a fix?

    • deroomaarten 1 year ago  | 

      *file node

      • deroomaarten 1 year ago  | 

        Found a solution for the people with the same problem.
        Delete all the .bgeo files in the geo folder and dirty and cook again

        • Higashibashi 11 months, 3 weeks ago  | 

          Damn I was looking for days to figure out what this kept happening from Section 3 glad I read Section 4.
          Is this the only way to fix it each time? Seems bizarre to keep getting red exclamations every reboot.

  • seelan 11 months, 2 weeks ago  | 

    Please submit any issues you find to our support so we can properly address them.

Please log in to leave a comment.