Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

Discussion in 'Assets and Asset Store' started by Rowlan, Jan 12, 2020.

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    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 :)

    Requirements


    Download


    Quick Setup

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

    hierarchy-menu.png

    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:

    vegetation mask.gif

    Center/Grow/Shrink Biome Mask:

    biome mask.gif

    Create Line Mask:

    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
     
    Graph, nirvanajie, Flavelius and 10 others like this.
  2. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    242
    Looks useful, thanks for sharing!
     
    Rowlan likes this.
  3. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    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:

    lines.gif
    You can either add them globally or attached to a specified Biome.
     
    rrahim and Lars-Steenhoff like this.
  4. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    242
    Very cool!
     
    Rowlan likes this.
  5. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    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.
     
    Last edited: Feb 1, 2020
    Lars-Steenhoff likes this.
  6. treshold

    treshold

    Joined:
    Nov 9, 2013
    Posts:
    223
    Looks very cool and useful! Was there option to assign different types of biome when creating random biome masks?
     
  7. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    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:

    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.
     
    dsilverthorn, mbussidk and treshold like this.
  8. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    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 :)

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

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    I added a few more features for easier road creation using easy roads 3d. Here's a usage showcase:

     
  10. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    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:

    render mode.png
     
    nirvanajie and dsilverthorn like this.
  11. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    There's a Refresh Prefabs Batch now as well. It applies "Refresh Prefab" on all Vegetation Items of the selected Biome.

    refresh prefabs.png

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

    Add inspector ui components like this:

    Code (CSharp):
    1.  
    2. GUILayout.BeginVertical("box");
    3. {
    4.    EditorGUILayout.Space();
    5.  
    6.    EditorGUILayout.LabelField("Refresh", GUIStyles.GroupTitleStyle);
    7.    {
    8.        if (GUILayout.Button("Refresh Prefabs"))
    9.        {
    10.            RefreshPrefabs(extension.biomeType);
    11.        }
    12.  
    13.    }
    14. }
    15. GUILayout.EndVertical();
    16.  
    implement whatever you want to achieve:

    Code (CSharp):
    1.  
    2. private class RefreshPrefabsProcessor : VegetationItemsProcessor
    3. {
    4.    public override void OnActionPerformed(VegetationPackagePro vegetationPackagePro, VegetationItemInfoPro vegetationItemInfoPro)
    5.    {
    6.        vegetationPackagePro.RefreshVegetationItemPrefab(vegetationItemInfoPro);
    7.    }
    8. }
    9.  
    and invoke it:

    Code (CSharp):
    1.  
    2. private void RefreshPrefabs(BiomeType selectedBiomeType)
    3. {
    4.    RefreshPrefabsProcessor processor = new RefreshPrefabsProcessor();
    5.    int itemChangeCount = processor.Process(selectedBiomeType);
    6.  
    7.    EditorUtility.DisplayDialog("Refresh Prefabs", "Refresh Prefabs applied to " + itemChangeCount + " items in Biome " + selectedBiomeType, "Ok");
    8. }
    9.  
     
    dsilverthorn likes this.
  12. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    490
    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. :)

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

    PS: the tropical island looks great! Love the foggy shot.
     
    Rowlan likes this.
  13. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    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:

    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):

    batch-function-touchreactactive.gif

    Update is live on GitHub.
     
    Willbkool_FPCS and dsilverthorn like this.
  14. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    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.
     
    dsilverthorn and KeithBrown like this.
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,403
    I modified the filter to list only the Biomes with available Vegetation Packages:

    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.

    bfa.png

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

    bff.png
     
    ftejada and dsilverthorn like this.
  16. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    490
    Excellent additions! The batch functions have been very helpful!
    Thank you!!!!
     
    Rowlan likes this.
unityunity