Setting up run-time loaded terrains

Setting up run-time loaded terrains

This guide will show the steps for setting up run-time loaded terrains with Vegetation Stuido Pro.

For run-time loaded terrains the Vegetation System Pro component needs to know the total world size. This allows it to create the internal structure and add/remove new terrains much faster.

Go to the Terrains tab and uncheck the automatic calculation checkbox. This will enable editing the total area bounds.  Enter the centerpoint of your terrains in worldspace coordinates and the extent in each direction. The example below has 10000 x 10000 meter area with a height of 500 meter.

Next we need to set up the terrains. For Unity terrains add the UnityTerrain component to the same GameObject as the terrain. The terrain has to be in the location it will have when loaded. The component will store this position for use with floating origin offsets.

Check the Add/remove at enable/disable checkbox.

When enabled this will look for VegetationSystemPro components when enabled and add the terrain automatic. It will also remove the terrain when the GameObject is disabled or destroyed.

The MeshTerrain and RaycastTerrain has similar settings.

In playmode when terrains are loaded by code or with additive scenes the terrains should register and spawn vegetation.

Lennart