"[FREE] Vegetation Studio Pro Extensions (Open Source, GitHub)" (772151)

Vegetation Studio Pro Extensions

Introduction

I really enjoy Prototyping with Unity. Most of my projects involve large terrains and populating them with Vegetation Studio Pro and the NatureManufacture assets. However, creating scenes over and over again can take a while. NatureManufacture already released 3 Biomes for Vegetation Studio Pro for their AAA assets, which are ready for use: Meadow Environment, Forest Environment and Ice World. The terrains in Unity become bigger and bigger and so I thought I should facilitate the population of large scale terrains via helper tools. This lead to this Asset, Vegetation Studio Pro Extensions. I thought this might benefit you guys as well, so I put it on GitHub for everyone for free. Download, use, fork, modify however you see fit :slight_smile:

Requirements

Download

Quick Setup

After you installed it, you’ll get a new popup menu for the scene hierarchy:

Features

Mask Spawner

Here’s a quick in-use video to get an overview what this is about:

Current features are:

  • Create random Biome Masks in various shapes

  • Voronoi

  • Rectangular

  • Hexagon

  • Random shape modifier allows to create randomly convex and concave masks

  • Multi-Tile-Terrain (naturally because Vegetation Studio Pro supports it)

  • Shape bounds variation

The bounds used for the shapes can be of the following:

  • Combined Terrains
    The bounds of all terrains of your Vegetation System combined

  • Individual Terrains
    All terrains of your Vegetation System are processed individually

  • Biome
    Another Biome Mask Area defines the bounds in which the shapes are created

More procedural spawners like Lake creation will follow in a future update.

Please note that this is currently in active development and bound to get non-backwards-compatible changes depending on requirements and feedback. Nontheless, after you are done with the Biome creation, you may as well remove this again, since the rest is just Vegetation Studio Pro standard usage.

Mask Modification

Other features involve the modification of Biome Mask Area, Vegetation Mask Area, Vegetation Mask Line.

  • Center / Grow / Shrink Vegetation and Biome Masks

  • Circle
    Get the bounds of the mask and create a circular shape using the existing nodes

  • Hexagon
    Get the bounds of the mask and create a Hexagon

  • Convex Hull
    Get all the nodes of the mask and create a Convex Hull using the node positons

  • Subdivide
    Adds new nodes between the existing nodes

  • Unsubdivide
    Removes every second node

Examples:

Center/Grow/Shrink Vegetation Mask:

5362512--542346--vegetation mask.gif

Center/Grow/Shrink Biome Mask:

4253551--379429--4-2.gif

Create Line Mask:

5362512--542352--line mask.gif

Beta

Please note that this is still beta and work in progress, so features may change and you should backup your project before you use this.

Credits & Thank You

17 Likes

Looks useful, thanks for sharing!

1 Like

One of the most requested features since yesterday was to create lines like NatureManufacture has them in the Meadow Environment demo. I added that feature today, new version is on github. Looks like this:

5365413--542796--lines.gif
You can either add them globally or attached to a specified Biome.

2 Likes

Very cool!

1 Like

I added RAM 2019 River Creation support:

It is basically a wrapper / batch function for the internal functions of RAM 2019’s spline simulation and generation. I left the terrain shaping out, one usually wants to verify the automatically created splines before doing a heavy terrain modification.

In order to use it, please add the scripting define symbol RAM_2019 after you installed RAM 2019.

1 Like

Looks very cool and useful! Was there option to assign different types of biome when creating random biome masks?

Thanks. Currently you can assign a single Biome Type which is then being pre-set for all Masks, of course you can change them afterwards using default Vegetation Studio Pro Mask editing. I see the necessity though to select multiple ones randomly. Currently by adding multiple instances of the Extensions you can mix different Biomes. Or you just select a different Biome Type and hit the “Add” button instead of “Clear & Add”.

Oh btw, I added a resize option which can be applied to all Biome Masks:

5431911--553155--shape.jpg
Gives a little padding around the Masks.

I think I better make a video about how to use these, also how you can mix different larger Biomes. But first I have to add one more module.

3 Likes

I added an Easy Roads 3D module which allows you to add markers automatically to a road, i. e. you can create circuit race tracks with it. The algorithm sticks to the existing Biome Mask settings, i. e. you could e. g. have the track limited to Biome bounds or Terrain bounds. In the video below the roads are created randomly over 4 Terrains. Looks like this:

The markers are aligned to the terrain in y position, so in addition to what I’ve shown here it’s best if you increase the polygon point count to have the road aligned tighter to the terrain, so that the terrain doesn’t get modified that intense.

As always, one thing leads to another and I think it might be even better to thave the road not only being created using a Voronoi cell, but rather have it created along the Voronoi edges of a terrain. This could lead to more realistic landscape roads. I totally have to try that :slight_smile:

In order to use it, please add the scripting define symbol EASY_ROADS after you installed Easy Roads 3D.

8 Likes

I added a few more features for easier road creation using easy roads 3d. Here’s a usage showcase:

8 Likes

I toyed around with HDRP yesterday. Main problem is that most Biomes I use don’t support Instanced Indirect. Changing the Render Mode of the many Vegetation Items manually to Instanced was too annoying, so I created a batch function for that. In case anyone needs it, it works with the Biome Type as filter:

5544400--570634--render mode.png

3 Likes

There’s a Refresh Prefabs Batch now as well. It applies “Refresh Prefab” on all Vegetation Items of the selected Biome.

5544562--570655--refresh prefabs.png

Just in case anyone wants to write their own batch, use the class BatchFunctionsEditor.cs

Add inspector ui components like this:

GUILayout.BeginVertical("box");
{
   EditorGUILayout.Space();

   EditorGUILayout.LabelField("Refresh", GUIStyles.GroupTitleStyle);
   {
       if (GUILayout.Button("Refresh Prefabs"))
       {
           RefreshPrefabs(extension.biomeType);
       }

   }
}
GUILayout.EndVertical();

implement whatever you want to achieve:

private class RefreshPrefabsProcessor : VegetationItemsProcessor
{
   public override void OnActionPerformed(VegetationPackagePro vegetationPackagePro, VegetationItemInfoPro vegetationItemInfoPro)
   {
       vegetationPackagePro.RefreshVegetationItemPrefab(vegetationItemInfoPro);
   }
}

and invoke it:

private void RefreshPrefabs(BiomeType selectedBiomeType)
{
   RefreshPrefabsProcessor processor = new RefreshPrefabsProcessor();
   int itemChangeCount = processor.Process(selectedBiomeType);

   EditorUtility.DisplayDialog("Refresh Prefabs", "Refresh Prefabs applied to " + itemChangeCount + " items in Biome " + selectedBiomeType, "Ok");
}
2 Likes

Awesome work!
I love these quick fixes. I use a ton of vegetation and not being able to load multiple plants at once due to having to switch every one, really made it a pain. Looking forward to trying this out. :slight_smile:

I love all of the other things you’ve made available to us to use, I really appreciate it! And I’m sure everyone else does too.

Thanks for all your hard work and letting us play with it too. :slight_smile:

PS: the tropical island looks great! Love the foggy shot.

1 Like

After yesterday’s Off-Road Game Creation Timelapse I thought the next logical step would be to add grass and Touch React in order to have the grass bend where the car drives. However for that to be possible one has to activate the TouchReactActive value on all of the plant materials one after the other. In order to make this step easier and quicker I added a new batch function which does that on the NatureManufacture materials:

5767174--607702--batch-function-touchreactactive.png

Once you set that and TouchReact collider is on an object, it should work like this (I made the collider bigger to show the effect better):

5766685--607615--batch-function-touchreactactive.gif

Update is live on GitHub.

2 Likes

I commited a minor update to GitHub: the Touch React Active is now only applied to Grass and Plants. It was on all vegetation items, even on trees. It didn’t make much sense there. In case anyone needs it, I can provide checkboxes for the various types (grass, plants, trees, objects, large objects), just let me know.

2 Likes

I modified the filter to list only the Biomes with available Vegetation Packages:

6063194--656708--bms.png

i. e. not all Biomes are listed anymore. In addition to that I added a “Modify All” option in the Batch Functions so that you don’t have to click through every single item one after the other.

6063194--656711--bfa.png

Unselect the checkbox to get the filter as it was previously:

6063194--656714--bff.png

2 Likes

Excellent additions! The batch functions have been very helpful!
Thank you!!!

1 Like

Thanks for this adddon! Personally I don’t feel VSP is complete without installing this little gem :slight_smile:

With that being said, It’s recently stopped working for me, unsure as to why all I’ve done is create a new project and installed my defaults (VSP / GAIA / etc), haven’t made any changes I’m receiving the following now:

CODE:
cell = new Cell(currentPolygon.ToArray(), centroid, ToVector(point));

ERROR:
Assets\AwesomeTechnologies\VegetationStudioProExtensions-master\Assets\VegetationStudioProExtensions\Common\Graph\Voronoi\DelaunayVoronoiGraph.cs(289,28): error CS1729: ‘Cell’ does not contain a constructor that takes 3 arguments

I’m not super up to speed on scripting so was hoping you might be able to offer some suggestions when available? Anyway, many thanks!! Awesome addon!

Thanks for the kind words :slight_smile:

This sounds like a namespace problem. The namespace was missing in the Utils class, but that was fixed in May. Are you using the latest version from github?

Yep, I’ve grabbed the latest from https://github.com/Roland09/VegetationStudioProExtensions

Changed my code, new version is on GitHub. The problem wasn’t with mine, but with another asset which had a same named class “Cell” embedded in a file without a namespace, i. e. it was on global namespace which has precedence over local. I changed mine nontheless to make it work.

2 Likes