Populate trees and vegetation using mask

Hello all,

I’m working on creating an environment, and I would like to procedurally populate it with vegetation, however, I want to select where that vegetation actually goes.

I saw @Leonidas approach to creating procedural terrain, but I’m not sure how I could have the trees only placed on specific spots.


Do you have a link to Leonidas approach for reference?


Hey @jonalexfilms! If you use the tiled terrain manager, there is a terrain-distribute script that does exactly that.

You are able to provide a black and white mask which defines where objects should be scattered, like this:



And here is a tutorial on how to set up a tiled terrain, with a mask to scatter objects around:

1 Like

Totally right @Leonidas - I focused on the shader for terrain and didn’t notice that the Trees and Rocks had a script.

Here’s where I’m at

  • I’m using actual google maps tiles.
  • I’m using OSM to get the “buildings” for the actual locations.
  • I got some grass with an alpha matted plane which is on top of the google maps tile

Next steps:

  • Tile the whole space proceduraly. The scene is orbiting on one building, so only the tile under that building matters for detail.
  • My thought is to use your terrain shader to create the buildings and replace my 6.8mb model. I’m not completely sure if it’s possible for the shader to procedurally create those tiles while getting the different building heights right. I need to put some real detailed time into creating the map to test this out. For starters: No gradients to make clean elevation, and gray scale to suggest height.
  • the correct syntax to access the other maps would follow this same format -> material.chunks[‘diffuseTexPS’] (‘nomalTexPS’, ‘glossTexPS’, etc). I’m thinking that if I can manage to get clean masks I could shade each tile correctly with asphalt, foliage and water, but I need the full maps package to make it work.

Any tips would be appreciate.


What was on my mind when I read “Populate trees and vegetation using mask”:


1 Like