S2ENGINE HD  1.4.6
Official manual about S2Engine HD editor and programming
Vegetation

S2Engine HD Terrain features a vegetation system lets you to paint vegetation.
Vegetation system is based on a map (a kind of texture map), called vegetation mask, every texel of the vegetation mask stores the index of a vegetation layer to show

Note
For every texel of the vegetation mask can store only one vegetation layer index at time. This means that if you, for example, paint the vegetation layer number 1 on a texel that stores vegetation layer number 0, this last is replaced by vegetation layer 1.

See Adding Vegetation to know how to paint vegetation on terrain.

Vegetation layers are stored inside vegetation assets (.vgl file).
To create a new vegetation layer open the vegetation browser as showed into the following image:

vegetation01.jpg

Then click right mouse button and select "New file" from the appearing drop-down menu:

vegetation02.jpg

Choose the name you want to give to file, press enter and then click on new button

vegetation03.jpg

Vegetation layers are simply text files that contains the description of how the vegetation must be organized when painted on the terrain,
i.e. what objects must be put into the vegetation mask.

To edit the created vegetation layer click right mouse button on the vegetation layer icon and select "inspect" from the appearing drop-down menu, as showed into the following image:

vegetation04.jpg

The vegetation layer editor panel will appear:

vegetation05.jpg

Vegetation is created by iterating 4 features that correspond to the 4 types of objects a vegetation mask supports and to the 4 groups of the Vegetation editor panel:

  • Grass that is composed by grass class objects placed every n pixels of the mask
  • Trees that are placed every min...max pixels of the mask
  • Plants that are placed randomly around the trees
  • Stones that are placed randomly around the plants

    The following are the parameters specific for the 4 groups
  • grass
    1. grass: file path of grass prefab containing the grass object
    2. grassDensity: grass object are places every grassDensity pixels on the mask.
  • trees
    1. tree0: file path of first tree prefab
    2. tree1: file path of second tree prefab
    3. tree2: file path of third tree prefab
    4. tree3: file path of fourth tree prefab
    5. minTreeDensity: tree objects are places every [minTreeDensity - maxTreeDensity] pixels of the mask.
    6. maxTreeDensity: tree objects are places every [minTreeDensity - maxTreeDensity] pixels of the mask.
  • plants
    1. plant0: file path of first plant prefab
    2. plant1: file path of second plant prefab
    3. plant2: file path of third plant prefab
    4. plant3: file path of fourth plant prefab
    5. minPlantNum: minimum number of plants that must be placed around a tree.
    6. maxPlantNum: maximum number of plants that must be placed around a tree.
    7. minPlantDist: minimum distance of plant from tree (expressed in mask pixels).
    8. maxPlantDist: maximum distance of plant from tree (expressed in mask pixels).
  • stones
    1. stone0: file path of first stone prefab
    2. stone1: file path of second stone prefab
    3. stone2: file path of third stone prefab
    4. stone3: file path of fourth stone prefab
    5. minStoneNum: minimum number of stones that must be placed around a plant.
    6. maxStoneNum: maximum number of stones that must be placed around a plant.
    7. minStoneDist: minimum distance of stone from plant (expressed in mask pixels).
    8. maxStoneDist: maximum distance of stone from plant (expressed in mask pixels).
Note
As you can note from the example trees,plants,stones are chosen randomly among the 4 ones specified into the vgl file.
It is not necessary to specify all 4 objects as different and it is not necessary to specify all objects.