This one goes to 11…

Setting up Vegetation Studio Pro Beta

The Vegetation Studio Professional beta has a few setup requirements.

The minimum requirement is Unity 2018.2 Beta 7. This will likely increase as Unity adds a bit more of the NativeArray/job interface.

Expected minimum version for release is Unity 2018.3

Set up a new project in Unity.

Go to Player settings and change the following settings.

  • Scripting Runtime Version to  .Net 4.x Equivalent
  • Api compability level to .net 4.x
  • Check Allow unsafe code

The unsafe code is temporary while waiting for some API changes.
.Net version will be a requirement.

 

Then open the manifest.json file in the Packages folder and replace the content with this.

The packages folder is in the same folder as “Assets”

{
"dependencies": {
"com.unity.ads": "exclude",
"com.unity.analytics": "exclude",
"com.unity.burst": "0.2.4-preview.9",
"com.unity.entities": "0.0.12-preview.5",
"com.unity.incrementalcompiler": "0.0.42-preview.2",
"com.unity.package-manager-ui": "1.9.9",
"com.unity.postprocessing": "2.0.7-preview",
"com.unity.purchasing": "exclude",
"com.unity.standardevents": "exclude",
"com.unity.textmeshpro": "exclude"
},
"registry": "https://staging-packages.unity.com",
"testables": [
"com.unity.collections",
"com.unity.entities",
"com.unity.jobs"
]
}

Unity will now load the needed packages. These packages are needed to get the Job system containers and Burst compiler installed for the project.
In the future all this will be set up from the Package Manager.

Unity still does not use the burst compiler when building to standalone builds but this is expected soon in a new beta update.

When done import the Vegetation Studio Pro beta package.

 

For better speed in the editor turn of the Jobs debuger and Leak Detection.

You can add the needed component with the menu selection under “Window/AwesomeTechnologies…”

The VegetationPackages has a new format. I may make an importer later but for the beta there is no backwards compability. There are some big changes. You create vegetation packages as normal.

The beta is still missing some of the features from Vegetation Studio. These will be added during the beta.

  • Collider system
  • Run-time prefab spawner
  • Touch react system (this could be installed manually but is not included in the package yet)
  • Vegetation Masks
  • Persistent storage (one for multiple terrains when finished)
  • Texture Mask system (needs to support multiple terrains. Textures need a worldspace rect and a way to group them together)

The new stuff!

The main change in Vegetation Studio Professional is the core technology used. It is based on the new Job system and Burst compiler technology Unity is adding to Unity 2018.2 +

This enabled better multithreading and use of the math optimized burst compiler. Using data oriented data structures gives faster data processing and results.

One of the bigger changes is that a single VegetationSystem component now can handle multiple terrains, multiple cameras and biomes.

Each biome has its own VegetationPackage.

Biomes are implemented as a BiomeMaskArea system where you define areas and assign a biome to them. These areas have their own splat map rules as well as vegetation, and there is an extensive set of blend rules to blend between biomes.  You can also stack multiple biomes on top of each other.

You can have a desert with an oasis on top with a lake. That lake can again have a underwater biome…

The BillboardSystem component is now integrated with the VegetationSystemPro component.

Here is a quick overview of the components.

Vegetation System Pro component

Settings tab

The settings tab holds the basic settings for the area.

  • Sea level
    This sets the sea level for the entire vegetation system. The height is relative to the lower bounds of the combined terrains.
  • Exclude sea level cells
    When excluding sea level cells entire cells that is bellow sea level will be excluded from the system.
  • Cell Size
    This is the cell size in meters for the internal vegetation culling. With all spawning using the Job system and burst compiler the default size is bigger than in Vegetation Studio Standard.
  • Billboard size
    This is the cell size of the billboards in meters. Used for culling and spawning billboards.

Cameras tab

You can add multiple cameras to one Vegetation System Pro object. When multiple cameras are used select the render direct to camera option. During editor mode you will also see a SceneCamera listed here. That is used for showing vegetation based on the active sceneview selection.

Terrains tab

You can now add multiple terrains to the VegetationSystemPro component.
There are now 3 terrain types available.  Unity terrains, MeshTerrains and Raycast terrains. These will all be explained below in the document.

Use the add all Unity terrains button or drag and drop terrains manually to add them. To add unity terrains manually you first need to add the UnityTerrain component to the same GameObject as the unity terrain. This implements an interface needed and all communication with the terrain.

For now use automatic calculation. The manual area definition is not ready yet and is planned for loading terrain run-time. This way you can define your world area and add in terrains run-time.

Floating origin is also not ready yet.

 

Vegetation tab

These settings are similar to the settings in the current Vegetation System version. They affect all added biomes(vegetation packages)

Biomes tab

It is now possible to add multiple biomes/vegetation packages to a single VegetationSystem Pro object. You select what biome you want as a default biome. This is the biome default used on the terrain.

The additional biomes each gets assigned a biome type and a sort order. The biome type will also be selected on the BiomeMaskAreas you define in the terrains.
Sort order is for stacked biomes.

Edit biomes tab

The edit biomes tab is where you can edit the biomes/vegetation packages. Select what added biome you want to edit the vegetation items for and add plants and grass as normal below.

There are some new rule types that will be described below.

2D grass is not yet completed.

Environment tab

The environment tab holds settings for snow, rain and wind. New in this version is ShaderControler classes that are loaded with reflection. These allow for 3rd party shaders to add UI and serialize settings that are saved with the Vegetation package. (see more info below)

A similar system allows for 3rd party wind settings to be exposed and saved. In this example the new HD wind from NatureManufacture and the wind of Fantasy Adventure Environment is installed.

The global snow and rain amount is passed to the shader controlers that can adjust settings for compatible shaders.

Render tab

The render tab holds setting similar to the current Vegetation Studio version. These affect all biomes.

 

New Vegetation Item spawning rules.

Noise rules

Noise rules have now been extended. In addition to normal cutoff rules there are options to use the noise values for both density and scale.

Biome area rules

Biome area rules are used for biomes not set to default biome.

  • Biome Edge scale rule
    The edge scale rule will allow you do scale the vegetation based on the distance to the biome edge. This can give you smaller trees in edge areas that transition to bigger and denser inside.
  • Biome Edge include rule
    The edge include rule will allow you to have Vegetation Items that just appear in the defined edge zone.

 

Shader controler classes

There is now a system for 3rd party shaders to define both UI and save settings.
The class is called with the vegetation items materials when any refresh is needed. This way the class can manage its own custom settings and the materials.

Speedtree and the Vegetation Studio grass shader are both implemented like this. In addition some shaders from NatureManufacture and Advanced Adventure Environment are included. Others will be added during the beta and in 3rd party packages.

The shader controller class detects the shader type on the vegetation item and the correct settings are created. This is done using reflection and new can be added without changing Vegetation Studio code.

Terrain types

There are now 3 types of terrain that can be added to Vegetation Studio. You can have any combination of these.

Unity Terrain

This component is used for the standard unity terrain. Add it to the same GameObject as the terrain and then drag/drop on the VegetationStudioPro component.

Mesh Terrain

The mesh terrain allows you to add any mesh in the scene with a MeshRenderer. it will build an internal BVH tree used for sampling the height and normal of the terrain when spawning vegetation. Terrain Texture rules will be ignored.

This also allows for multi level spawning.

You can add a mesh terrain source to each of the meshes. This will be exposed later as spawning rules. Grass that only grows on rooftops etc.

Raycast Terrain

Add the raycast terrain to any gameobject and define a bounds relative to the object position.
It will then raycast the layers selected for colliders to find terrain position/normal during spawning.

Raycasting is done usin the new RaycastCommand jobs.

Biome Mask Area

The biome mask area is a polygon area component used to define biome areas. It works in the editor much like the VegetationMask area.

When the area is defined you can adjust the blend settings for the overlap area between the biomes.

The ground layer setting is for use with mesh and raycast terrains when adding nodes.

Add the component to any GameObject. Select your biome and add nodes.

Terrain System Pro

The terrain system component is used for generating splatmaps for the biomes.

Each biome can have its own set of splatmap rules. Each biome can use any combination of the terrain textures on the terrain.

Select what biome to configure and press the Generate Biome Splatmaps button to generate the splatmap.

There is also a new heatmap mode that shows each textures cover on all unity terrains.