Setting up Vegetation Studio Pro Beta
Setting up Vegetation Studio Pro Beta
This document will give you a quick guide to setting up Vegetation Studio Pro and biomes in a new project. It uses the new job system and burst compiler and requires some additonal setup.
Setting up Unity
The Vegetation Studio Professional beta has a few setup requirements.
The minimum requirement is Unity 2018.2.0f2. 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 4.x version will be a requirement for final release also.
Then open the Package Manager from the window menu.
Select and install the Burst and Entities packages.
Your package list should now look like this.
These packages are needed to get the Job system containers and Burst compiler installed for the project.
When done import the Vegetation Studio Pro beta package.
For better speed in the editor turn of the Jobs debuger and Leak Detection.
To use the burst compiler in standalone builds you need to make sure to install Windows SDK and VC++ toolkit from Visual Studio Installer
Install the latest available version of each.
Adding Vegetation Studio Professional to a scene.
After installing the Vegetation Studio Pro beta package you can add Vegetation Studio Pro to the scene using the “Add vegetation Studio Pro to scene” menu.
This will add the required component to the scene. The VegetationSystemPro object is what you will use most of the time.
If you add the terrain to the scene after adding VS Pro you need to manually add the terrain.
Find the Terrain and add the UnityTerrain component.
Next on the terrains tab on the Vegetation System pro component you drag and drop the terrains. You can add multiple terrains here.
The world area will be calculated automatic from all added terrains. For setups where you load terrain run-time you uncheck automatic calculation and define the total world area.
Next we create vegetation packages/biomes. These are scriptable objects that hold all the rules for vegetation spawning. For this example we will create 2 biomes. a default biome and a forest.
If you are going to use biomes together and create splat map rules it is important that all biomes are set up with the same number of textures.
Each biome can have its own splat map generation rules and use any subset of the total textures. This way one biome can use textures 1-5 while the other uses 4-8. There is no problem for the biomes to use the same textures. When the splatmap is generated the rules will be used inside the biome mask area.
Next you add the biomes to the biomes tab of the Vegetation System and name them. Here i set my “default” biome as default and the other as a forest biome. This biome type will also be set on the BiomeAreaMasks we create later.
When added you can select what biome to edit on the edit biome tab. This process is similar to normal Vegetation Studio
Setting up a biome mask area
The default biome will be used everywhere where there is no BiomeMaskAreas. Add the BiomeMaskArea to a component and edit the nodes to select the area you want. There is also a pre made prefab you can drop in the scene.
For each biome mask area you select what biome should be in the mask area. If the Vegetation System has a biome/vegetation package of the same type it will be spawned within the mask.
There is a TerrainSystem component on the same GameObject as the VegetationSystem component. This is used to set up splatmap rules for the added biomes. Select the biome you want to edit. Then enable the Use with splat map generation setting on the textures you want to use with this biome. You then set the distribution curves for height and steepness. There is also noise and weight settings.
Press the generate button to generate the splatmap for all terrains added to the vegetation system.