This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Generating Vegetation

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Engineering / Sim SDK edition to use it.

The following steps are used to generate vegetation such as trees and grass on the basis of landcover data available.

Watch the dedicated video tutorial to get familiar with vegetation generation.

The basic workflow is as follows:

1. Preparing a Basic Object#

First, we create a basic object that will be used as a building block for generation of vegetation (e.g., grass, trees etc.). The following types of basic objects are supported:

  1. Create a basic object of the desired type.

  2. Specify parameters of the basic object in the Parameters window.

    Notice
    Intersections with parent object must be enabled for all types of basic objects. The intersection flag can be found on the tab of the Parameters window corresponding to the type of the object.

  3. Inherit a material, set all necessary textures and parameters and assign it to the basic object.

    Notice
    The Landscape Tool generates R8 textures to be used as masks for Grass objects. Therefore, you need to prepare a grass node with a corresponding diffuse texture, containing 1 vertical column of grass chunks, in its material.
  4. Export your node to a .node file (e.g. grass.node) and then delete the node from the world.

  5. Now our basic object for grass (grass.node) is ready to use and you can delete it from the scene.

2. Adding a Landcover Data Source and Specifying Tags#

Now, we add a landcover data source to be used for generation. If the data source is already added, you may skip to step 3.

  1. Open the Landscape Tool window, for this purpose on the Menu bar, click Windows -> Landscape.

  2. In the Sources panel, add necessary landcover data sources (see Specifying Data Sources section).

    Notice
    R8 and RGB8 mask textures are supported.
  3. Select each landcover data source from the ones you added in the Sources panel and specify parameters in the Parameters panel. Depending on the type of the source data (the geo-referenced or the source tileset one), the set of parameters differs. The parameters of the source with no geodata are the same as for the elevation data sources (except Tileset Elevation Settings).

    Parameters of Source With No Geodata
    Geo-Referenced Source Parameters

    Very often landcover data sources have insufficient density, which results in squared borders of grass-covered areas, etc. You can use data from vector sources to generate landcover objects and detail masks. Just rasterize a vector source to a landcover with any density you need and use it as usually. This feature is available via the Create landcover mask button in the Parameters window, when a desired vector data source is selected. In the window that opens you can specify vector tags to filter data for each target channel (up to 4 channels are supported).

  4. Add tags for each type of landcover objects you are going to generate by clicking Add button at the bottom of the Parameters panel and specifying a tag name. To remove a tag use Remove button.

    Notice
    You can't add tags named "height" and "mask" as these names are reserved for procedural refinement.
  5. For each tag you can specify a set of filters (OR) to select certain data from the landcover data source. You can add as many filters as necessary. This can be done as follows depending on the type of the landcover data source:

    • For an R8 texture data source - by setting the range of bits (from value, to value) to be treated as a certain type of vegetation.
    • For an RGBA8 texture data source - by selecting a base color and setting threshold value for a color gradient to be treated as a certain type of vegetation.
    Notice
    Use "+" (plus) button to add a filter, or "-" (minus) to remove one.
    1-channel R8 texture. 3-channel RGBA8 texture.
  6. Now all necessary tags and filters are added and you can proceed to the next step.

3. Specifying Vegetation Parameters#

Now, we must specify basic objects created at the first step and bind them to the tags.

  1. On the Sources panel, select the Masks (Landcover) data source type and the following settings will be displayed in the Vegetation tab of the Parameters panel.

  2. Add a basic object for generation by clicking Add button and specify object's name. You can add as many objects as nesessary.

  3. For each basic object specify the following parameters:

    Node The path to the basic mesh object's *.node file.
    Landcover tag The tag for the selected landcover object from the list of tags specified at the second step.
  4. Check the basic objects you added at the previous step to be generated.
    Notice
    If you are going to update some of the existing vegetation objects, check only the changed ones. At that, the other objects will remain the same after terrain generation.
  5. Now all necessary basic objects are specified and bound to tags.

    Notice

    If the terrain is already generated and you want to add or change only vegetation - proceed to Step 4.

    Otherwise - return back to setting other parameters of terrain generation.

4. Generating Vegetation#

Now you can generate vegetation by clicking Generate button and selecting Landcover objects option in the Steps window, in this case only landcover objects will be generated.

Here is a terrain fragment with vegetation generated on the basis of landcover data using the basic Mesh Clutter object for close trees and the Grass object for tree impostors on far distances.

A fragment of a terrain with vegetation (Click to watch the video tutorial)

To regenerate some of the existing vegetation objects, check only those objects that should be updated, click Generate and select Landcover objects option. Only the specified vegetation objects will be regenerated. At that, the other ones (that haven't been checked) will remain the same.

Last update: 2022-03-10
Build: ()