This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
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
创建内容
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

生成道路

警告
本文介绍的功能在 Community SDK 版本中不可用。
您应该升级到 Engineering / Sim SDK版本才能使用它。

Roads are generated by tiling a decal created from a primary static mesh along the vector data available.道路是通过沿着可用的矢量数据平铺从基本静态网格创建的贴花来生成的。

Let's review the general workflow.让我们回顾一下基本的工作流程。

注意
The article assumes that you have already added the data required for the terrain surface.假设您已经添加了所需的数据地形表面.

1. 准备一个基本对象#

First, we create a Mesh Static object that will be used as a building block for the generation.首先,我们创建一个 Mesh Static 对象,它将用作生成的构建块。

注意
The Mesh Static object must be located and have a pivot at the origin (0, 0, 0).必须找到 Mesh Static 对象并在原点 (0, 0, 0) 处有一个枢轴。
  1. Create a mesh (we use a plane for the road here): click Create —> Primitive —> Plane on the Menu bar.创建一个网格(我们在这里使用平面作为道路):在菜单栏上,单击 Create —> Primitive —> Plane

  2. Specify the mesh parameters. For our road, we set the following:指定网格参数。对于我们的道路,我们设置了以下内容:

    注意
    We recommend using more than a single segment to make road curves smoother.建议使用多个路段,以使道路曲线更平滑。
  3. Inherit a material from mesh_base, set all necessary textures and parameters, and assign it to the mesh.mesh_base 继承材质,设置所有必要的纹理和参数并将其分配给网格。

  4. The road is generated by tiling the primary mesh along one of the axes X, Y, or Z (forward axis), so make sure that your mesh is oriented correctly — in this case, the forward axis is X (red arrow).道路是通过沿轴 X, YZ向前轴)之一平铺基本网格来生成的,因此请确保您的网格方向正确——在这种情况下,向前轴是 X(红色箭头)。

  5. Geometry is very resource-consuming. Thus, to maintain acceptable performance, you should set up LODs for the primary mesh. For each surface of the mesh, specify visibility and fade distances. These settings will be used for managing LODs of generated spline objects.Geometry 非常消耗资源。因此,为了保持可接受的性能,您应该为基本网格设置 LOD。对于网格的每个表面,指定可见性和淡入淡出距离。这些设置将用于管理生成的样条对象的 LOD。

    For more information on LOD settings, see Setting Up Object LODs.有关 LOD 设置的更多信息,请参见设置对象 LOD .

  6. Move the mesh to the origin and export it to a .node file.将网格移动到原点并将其导出到 .node 文件.


Now that the primary node for roads (the *.node asset) is ready to use, you can delete it from the scene.

现在道路的基本节点(*.node 资产)已准备好使用,您可以将其从场景中删除。

2. Adding a Vector Data Source2. 添加矢量数据源#

Currently, Sandworm allows using only offline vector data sources for the generation.目前,Sandworm 只允许使用离线矢量数据源进行生成。

  1. In the Sources panel:Sources

    • Clicking on Vector opens the window for adding Slots. Slots are designed to organize data.点击 Vector 打开添加插槽的窗口。槽被设计成将数据组织到不同的地形掩模中。

      Slots

    • Clicking on + Add Layer provides the toolset for uploading vector data.点击 + Add Layer 提供了上传土地覆盖数据的工具集。
  2. When adding a layer, define the type of Data Source to be used: Assets or External Files. Currently, only *.shp and *.geojson are supported as assets. Therefore, if you have other types of files, you can try to add them as External Files.当添加一个层,定义数据源类型使用:AssetsExternal Files。目前仅支持 *.shp*.geojson 作为资产。因此,如果您有其他类型的文件,您可以尝试将它们添加为 External Files

    Click Import.单击 Import

  3. In the window that opens, select the set of files to be used as vector data.在打开的窗口中,选择要用作矢量数据的文件集。

When the vector data is added, its image is displayed atop all the layers in the Preview panel (you may change the order of layers display by RMB click on a layer in the list of sources), and the Vector layer parameters become available.添加矢量数据后,其图像将显示在预览面板中所有图层的顶部(图层显示顺序可能会更改),并且矢量图层参数变为可用。

3. Specifying Filters for Vector Data3. 指定过滤器来过滤矢量数据#

The Filter is a set of rules used to pick the specific data from the list of all available vector data. The rules are created using Attributes, and only the objects that fit the requirements of every attribute are generated based on this Filter. Filter 实际上是一组规则,用于从所有可用矢量数据的列表中挑选特定数据。规则是使用 Attributes 创建的。只有符合每个属性要求的对象才会基于此过滤器生成。

Filters are created as follows:过滤器创建如下:

  1. Click the Add button in the Filters window of the Parameters panel.单击 Parameters 面板的 Filters 窗口中的 Add 按钮。

    Double-click on the Filter to specify a Filter name. To remove a Filter, use the Remove button. You can add as many Filters as necessary.双击过滤器以指定过滤器名称。要删除过滤器,请使用 Remove 按钮。您可以根据需要添加任意数量的过滤器。

    The Share button allows shared use of the Filter among source data layers. Select the source data layer that will share this Filter in the pop-up window. Changes in a shared Filter will be applied to it in all source data layers.Share 按钮允许在掩码之间共享使用过滤器。在弹出窗口中选择共享此过滤器的掩码。共享过滤器中的更改将应用于所有遮罩中

  2. 从您创建的槽中选择一个槽 (Sources -> Vector)。槽被设计成将数据组织到不同的地形掩模中。
  3. For each Filter, set an Attribute (or Attributes) to filter specific data from the vector source. The required data is filtered using the attribute value and a suitable operator. Autocomplete is available — you can type in Attribute names and values or select them from the Attribute list.对于每个过滤器,设置一个(或多个)属性以过滤来自矢量源的某些数据。使用属性值和合适的运算符过滤所需的数据。自动完成可用。您可以输入属性名称和值或从属性列表中选择它们。

    The available operators are: =, !=, >, <, ANY. ANY generates all the objects that have any value assigned for the selected attribute.可用的运算符是:=, !=, >, <, ANYANY 生成为所选属性分配了任何值的所有对象。

    You can also select attribute values from the Attributes table. The table opens using the sign on the right of the attribute expression.您还可以从 Attributes 表中选择属性值。该表使用属性表达式右侧的 符号打开。

    Double-clicking on a value in the table adds it to the attribute value field.双击表中的值将其添加到属性值字段。

  4. To add more attributes, use the "+" (plus) button. You can add as many Attributes for one Filter as necessary. It is possible to set AND and OR relations between the Attributes in the Filter.要添加更多属性,请使用“+” (加号)按钮。您可以根据需要为一个过滤器添加任意数量的属性。 可以在过滤器中的属性之间设置 ANDOR 交互。

    To remove an Attribute, use the button to the right of the Attribute expression.要移除过滤器,请使用属性表达式右侧的 按钮。

4. Specifying Parameters of Vector Objects4. 指定矢量对象的参数#

In this step, we set objects that will be generated and placed across the terrain's surface according to the data picked out by the Filter.在这一步中,我们将设置对象,将生成和放置在表面的地形,根据数据挑选出的过滤器

  1. On the Sources panel, click + Add Object.Sources 面板上,单击 + Add Object.

  2. 在下拉列表中,根据槽数据选择要生成的对象类型。在我们的例子中,是 Roads。单击 Import

Set the following object parameters:设置以下对象参数:

Slot 由您创建的用于组织数据过过滤器的槽。
Enabled 当打开时,将生成这种类型的对象。关闭时,这种类型的对象不会生成,也不存在于包含生成的地形的世界中。
Node The path to the primary object's *.node file.通往基本对象*.node 文件。
Decal texture resolution

贴花烘焙纹理的分辨率。

注意
仅适用于贴花类型。
Split segments

指示是否启用分段拆分模式的标志。在此模式下,所有段将被分成指定长度的子段(如果此长度不超过段本身的长度)。

注意
此参数可用于提供贴花与地形的更好对齐。
Split segment length

分割模式段的长度,单位。

注意
值越低,生成的段就越多。设置太低的值可能会显着降低性能。
Split lines length (km) 指示是否启用行拆分模式的标志。默认情况下,应为指定过滤器生成单个贴花对象,并应包含所有相关贴花。当启用分线模式时,将线分成指定长度的部分(如果该长度不超过线本身的长度)。每个部分将由一个单独的贴花对象表示。
Adjust terrain heights and masks

Flag indicating whether terrain heights and masks will be adjusted for generated roads. When this option is enabled, the following terrain data will be modified in the areas along the roads (vector data) having the width specified by the Area Width parameter:指示是否为生成的道路调整地形高度和掩码的标志。启用此选项后,将在道路沿线区域(矢量数据)中修改以下地形数据,其宽度由 Area width 参数指定:

  • Height data will be adjusted (flattened) to provide better alignment of generated roads with the terrain surface.height data 将被调整(扁平化)以提供生成的道路与地形表面更好的对齐。

  • Masks data will be cut out (e.g. preventing grass from growing on roads).masks data 将被删除(例如,防止道路上长草)。

    注意
    All masks will be affected.所有口罩都会受到影响。

注意
  • Enabling this option significantly increases generation time.启用此选项会显着增加生成时间。
  • Adjustment will affect all height and mask LODs of the global terrain having the density satisfying the following condition:调整将影响密度满足以下条件的全局地形的所有高度和遮罩 LOD:

    Density < Area width x 6.

Area width

Width of the area along the spline to be affected by heights and masks adjustment.沿样条线受高度和遮罩调整影响的区域的宽度。

注意
Available only when heights and masks adjustment is enabled.仅在启用 heights and masks adjustment 时可用。
Forward axis Axis along which the primary mesh is to be extruded or tiled.基本网格沿其拉伸或平铺的轴。

5. Generating Roads5. 生成道路#

Now you need to configure the output settings and generate (or regenerate) roads on the terrain by clicking the Generate button.现在你需要配置输出设置产生(或者再生) 通过单击 Generate 按钮在地形上的道路。

A terrain fragment with roads generated based on vector data using the primary mesh object:使用我们创建的基本网格对象根据矢量数据生成带有道路的地形片段:

最新更新: 2021-12-13
Build: ()