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.


コメント

  • 3clipse 1 週間, 3 日 前  | 

    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...

  • 3clipse 1 週間, 3 日 前  | 

    Oh everything cooks fine in Houdini but fails in Unity

    • wtrebella 1 週間 前  | 

      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 6 日, 18 時間 前  | 

        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!

  • wtrebella 1 週間, 1 日 前  | 

    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?

    Thanks!

    • 3clipse 1 週間, 1 日 前  | 

      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.

Please log in to leave a comment.