This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

常問問題

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

This article aims to help with questions that arise when you use the Sandworm terrain generation tool.本文旨在帮助您解决使用 Sandworm 地形生成工具时出现的问题。

There is a number of general tips that may be useful for overall understanding:有一些一般提示可能有助于整体理解:

  • Open the Editor console (Windows -> Console). If something goes wrong, a console message might be useful in explaining the situation.打开编辑器控制台 (Windows -> Console)。如果出现问题,控制台消息可能有助于解释情况。

    Console errors

    Example of console errors控制台错误示例
  • If you suspect that the height data have some issues, you can enable the debug mode to check: Rendering Debug -> Opacity World Normal.如果怀疑高度数据有问题,可以开启调试模式检查:Rendering Debug -> Opacity World Normal
  • Don’t worry about the number of triangles in ObjectLandscapeTerrain. This object was designed in a way that millions of polygons wouldn’t affect the framerate that much.不用担心人数三角形ObjectLandscapeTerrain 中。该对象的设计目的是使数百万个多边形不会对帧速率产生太大影响。
  • Clear cache before you start terrain generation: click the button near the cache address line in the bottom left corner of the Sandworm window.清除缓存开始地形生成之前:单击 Sandworm 窗口左下角缓存地址行附近的 按钮。

What is the difference between ObjectTerrainGlobal and ObjectLandscapeTerrain? ObjectTerrainGlobal 和 ObjectLandscapeTerrain 有什么区别?

Currently, UNIGINE has two objects that are used for terrain: ObjectTerrainGlobal, which has long been in use, and comparatively recently introduced ObjectLandscapeTerrain, which has many improvements.目前,UNIGINE 有两个用于地形的对象:ObjectTerrainGlobal,长期使用,比较最近引入了 ObjectLandscapeTerrain,有很多改进。

These two terrain objects can be generated using the Sandworm Tool.这两个地形对象可以使用 Sandworm 工具生成。

The Sandworm Tool as well as ObjectLandscapeTerrain were developed to solve the problems, which have accumulated over the years, and extend the functionality.Sandworm 工具和 ObjectLandscapeTerrain 都是为了解决多年来积累的问题,并扩展功能而开发的。

Where can I take the geodata?我在哪里可以获取地理数据?

As a rule, access to private TMS servers is not free, however, there are free data sources supported by donations. If you are not in the mood of searching, you can check the list here. Keep in mind that every server has its own features and check the information in description.通常,对私人 TMS 服务器的访问不是免费的,但是,有捐赠支持的免费数据源。如果您没有心情搜索,可以查看列表在这里。请记住,每个服务器都有自己的功能并检查描述中的信息。

Heights高地

For example, you can try the mapbox service. Register there in order to obtain your own token and access, for more details see this page.例如,您可以尝试mapbox 服务。在那里注册以获得您自己的令牌和访问,更多详细信息请参见 本页

Free access limits the number of requests per minute, but that doesn’t affect the overall workflow and is enough for general overview.免费访问限制了每分钟的请求数,但这不会影响整个工作流程,并且足以进行一般概述。

As soon as you register, you’ll receive a token which is a string of various symbols. Add this token to the following URL after the equality sign (=): https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=YOUR_ACCESS_TOKEN, and use this URL in Sandworm to obtain the data for the corresponding level.注册后,您将收到一个由各种符号组成的字符串的令牌。在等号(=)后添加这个token到如下URL:https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=YOUR_ACCESS_TOKEN,并在Sandworm中使用这个URL来获取对应级别的数据。

注意
To avoid jaggies (stair-step artifact), export the height data into a 32-bit texture.为避免锯齿(阶梯伪影),请将高度数据导出为 32 位纹理。

Imagery意象

Here's an example of an imagery TMS server you can use for general overview:以下是可用于一般概述的图像 TMS 服务器示例:

  • http://a.tile.openstreetmap.org/{z}/{x}/{y}.png — OSM topographic data with a legendhttp://a.tile.openstreetmap.org/{z}/{x}/{y}.png — 带有图例的 OSM 地形数据

Vector向量

As a free source of vector data for a basic overview, you can check https://www.openstreetmap.org and use https://extract.bbbike.org/ as an aggregator for it.作为一个矢量数据的免费来源,您可以检查 https://www.openstreetmap.org 并使用 https://extract.bbbike.org/ 作为该数据的聚合器。

The mentioned links and sources are provided as a quick start for an overview. You can use them and the Sandworm documentation if you don’t have any georeferenced data at hand. Exporting data from third-party tools is a huge topic for research in itself, and would take much more time than getting along with our tool.提供上述链接和来源作为概览的快速入门。如果您手头没有任何地理参考数据,您可以使用它们和 Sandworm 文档。从第三方工具导出数据本身就是一个巨大的研究课题,并且比使用我们的工具需要更多的时间。

Which projection should I select to have the minimum surface distortion?我应该选择哪个投影以使表面变形最小?

Unfortunately an all-fitting universal projection doesn’t exist, because every projection is a flat representation of a curved area, and the farther a point is from the center (origin) of the projection, the higher the data corruption is. You can find more on Wikipedia or search for other explanations on projections. The output projection should be chosen based on source data at hand or the project requirements.不幸的是,不存在全拟合的通用投影,因为每个投影都是弯曲区域的平面表示,并且点离投影的中心(原点)越远,数据损坏程度就越高。您可以找到更多关于维基百科或搜索有关射影的其他解释。应根据手头的源数据或项目要求选择输出投影。

You can use https://epsg.org/ to find the best-fitting projection with minimum inaccuracy for the selected area.您可以使用https://epsg.org/ 为所选区域找到误差最小的最佳拟合投影。

How to use https://epsg.org/:如何使用https://epsg.org/:

  1. Go to EPSG Dataset -> Map Search:转到 EPSG Dataset -> Map Search:

    注意
    If the website doesn't display any map, consider disabling adblock or using a VPN.果网站不显示任何地图,考虑禁用广告屏蔽或使用VPN。
  2. Set the area boundaries and click Search. You’ll receive a table — sort it by type (click on the TYPE heading) and select one of the data sources that is marked as Projected.设置区域边界并单击 Search。您将收到一个表格,按类型对其进行排序(单击 TYPE 标题)并选择一个标记为 Projected 的数据源。

Again, for a start, you can use EPSG:3857 — this is a projection widely used by such services as Google, OpenStreetMap, Navitel, etc.同样,首先,您可以使用 EPSG:3857 — 这是 Google, OpenStreetMap, Navitel 等服务广泛使用的投影。

A heightmap/imagery tile is not placed as required. How to locate it properly on the map?未按要求放置高度图/图像图块。如何在地图上正确定位?

If your data is not georeferenced, it won’t be located on the map (check the editor console, there also shall be a message).如果您的数据没有地理参考,它不会位于地图上(检查编辑器控制台,也会有一条消息)。

Are tiles loading or not?是否正在加载瓷砖?

The more detailed the tiles are, the more time is required to load them. The Generating Preview pop-up will give you a hint — it is displayed in the bottom right corner of Sandworm while the data is downloaded. In addition, in the Editor console there’ll be a message looking like "ImportCacheTile 465.162000 ms" when a tile is loaded.瓷砖越详细,加载它们所需的时间就越多。 Generating Preview 弹出窗口会给您一个提示——它在下载数据时显示在 Sandworm 的右下角。此外,在编辑器控制台中,加载磁贴时会显示一条类似于 "ImportCacheTile 465.162000 ms" 的消息。

We recommend attempting with low Zoom values first. This will give you an overall understanding about the data you add, then you can increase the Zoom value and click Reimport. The higher the Zoom value is, the more detailed is the data (and the more time it takes to download from a server). If the data is too heavy, you’ll see a notification.我们建议首先尝试使用低 Zoom 值。这将使您对添加的数据有一个整体的了解,然后您可以增加 Zoom 的值并单击 ReimportZoom 值越高,数据越详细(从服务器下载所需的时间越长)。如果数据太重,您会看到通知。

Sometimes neighboring tiles are of different colors. Is there any workaround for that?有时相邻的瓷砖颜色不同。有什么解决方法吗?

This can happen when you take data from TMS servers. Better data usually costs money.当您从 TMS 服务器获取数据时,可能会发生这种情况。更好的数据通常要花钱。

You can try to change Zoom for a certain area. One more solution is to make insets using other TMS sources: for example, you generate the whole area with Zoom = 10, and for the problem area — create another layer, use another source for it, and set Zoom = 14 (the given zoom values are just an example, try your own values).您可以尝试更改某个区域的 Zoom。另一种解决方案是使用其他 TMS 源制作插图:例如,您使用 Zoom = 10 生成整个区域,对于问题区域 - 创建另一个图层,为其使用另一个源,并设置 Zoom = 14(给定的缩放值只是一个例如,尝试您自己的价值观)。

The result of generation is wrong. / Only a part of the area has been generated.生成结果错误。 / 只生成了部分区域。

Check that the output projection is set correctly.检查输出投影设置是否正确。

If the data is outside the selected output projection, it won’t be used for the terrain generation — only the part that is inside will be generated. The corresponding message will be also shown in the Editor console.如果数据在所选输出投影之外,则不会用于地形生成 - 只会生成位于内部的部分。相应的消息也将显示在编辑器控制台中。

A quick check: re-generate the project without defining the Export Area (select the Export Area option and click the Press to Clear button in the Parameters tab). Sandworm will generate only the areas for which the data is available.快速检查:在不定义 Export Area 的情况下重新生成项目(选择 Export Area 选项并单击“参数”选项卡中的 Press to Clear 按钮)。 Sandworm 将仅生成数据可用的区域。

Preview generation is also helpful in defining if you have data for the area that is missing. If you canceled the preview generation, restart it by right-clicking on a layer and selecting Generate Preview.预览生成还有助于定义您是否有缺失区域的数据。如果您取消了预览生成,请通过右键单击图层并选择 Generate Preview 来重新启动它。

Only a part of the generated terrain is visible in the viewport.只有一部分生成的地形在视口中可见。

Change the camera visibility distance: in the Editor window, click the gear icon for the selected camera and increase the Far value. You can set the maximum, which is 900000.更改相机可见距离:在编辑器窗口中,单击所选相机的齿轮图标并增加 Far 值。您可以设置最大值,即 900000

Adjust the visibility distance for ObjectLandscapeTerrain. It is set in the Editor settings: Windows -> Settings -> Landscape -> Visibility Distance. You can set it to inf.调整 ObjectLandscapeTerrain 的可见距离。它在编辑器设置中设置:Windows -> Settings -> Landscape -> Visibility Distance。您可以将其设置为 inf

设置 Landscape Terrain 的可见距离

When I click Run, I see the black screen after the world is loaded, although there are cameras in the scene.当我点击运行时,我看到加载世界后黑屏,虽然场景中有摄像头。

The scene contains a camera by default, which has the Main Player parameter enabled. This parameter defines the image from which camera is displayed when the world is run. Enable this parameter for the camera that you want to control at runtime, for example Sandworm camera — it is spawned right above the terrain, and disable all other cameras.场景默认包含一个启用了 Main Player 参数的相机。此参数定义在世界运行时显示摄像机的图像。为您要在运行时控制的相机启用此参数,例如 Sandworm 相机 - 它在地形正上方生成,并禁用所有其他相机。

Is there a built-in day and night cycle system (with the starry sky) that depends on the current latitude and longitude?是否有内置的昼夜循环系统(有星空),取决于当前的经纬度?

We have the IG plugin for this task. This plugin is enabled by default in the IG Template, you can read more here and here.我们有这个任务的 IG 插件。该插件在IG模板中默认启用,您可以阅读更多这里这里.

How to position an object using its geo coordinates?如何使用地理坐标定位对象?

For ObjectTerrainGlobal, you can use Geodetic Pivot in the Editor — every object added as its child can be positioned on the terrain using geographical coordinates set in latitude/longitude.对于 ObjectTerrainGlobal,您可以在编辑器中使用 Geodetic Pivot — 作为其子对象添加的每个对象都可以使用在 latitude/longitude. 中设置的地理坐标定位在地形上

As for ObjectLandscapeTerrain, the positioning tool is still in development, meanwhile you can transform coordinates using third-party sources, such as https://products.aspose.app/gis/transformation.至于ObjectLandscapeTerrain,定位工具还在开发中,同时可以使用第三方源转换坐标,比如https://products.aspose.app/gis/transformation 。

Here is a description of the workflow:以下是工作流程的说明:

  • Transform the object and the origin coordinates to the world coordinates (mind the input and output projections).将对象和原点坐标转换为世界坐标(注意输入和输出投影)。

    对象的源坐标

    Source coordinates of the object (screen capture from Google Maps)对象的源坐标(来自谷歌地图的屏幕截图)


    原点的源坐标

    Source coordinates of the origin (Export Area parameter in Sandworm)原点的源坐标(Sandworm 中的导出区域参数)


    使用 aspose.app 变换坐标

    Transforming coordinates using aspose.app使用 aspose.app 变换坐标


  • Take the origin position from the object position: Object.X — Origin.X; Object.Y — Origin.Y.从物体位置取原点位置:Object.X — Origin.X; Object.Y — Origin.Y

    计算场景(世界)中的坐标

    Calculating the world coordinates计算场景(世界)中的坐标
  • Use the outcome as the X and Y coordinates of the object in the world.将结果用作世界中对象的 X 和 Y 坐标。

    对象定位在世界上

    Object positioned in the world对象定位在世界上

Developers can also use Geodetics Plugin and position objects via code.开发人员还可以通过代码使用 Geodetics Plugin 和定位对象。

IG Plugin has the worldToGeodetic() method and GeodeticsTransformer class to position objects.IG 插件有worldToGeodetic()方法和 GeodeticsTransformer 类来定位对象。

Terrain is not generated. / Editor suddenly closes.不生成地形。 / 编辑器突然关闭。

Generating a terrain is a very resource-consuming operation. For vast and detailed landscapes, you might need a lot of RAM available.生成地形是一项非常耗费资源的操作。对于广阔而细致的景观,您可能需要大量可用的 RAM。

We recommend having 64 Gb RAM (at least 32 Gb).我们建议使用 64 Gb RAM(至少 32 Gb)。

Disabling the Microprofile tool can also save up to 6 Gb RAM. This may be done either by running the Editor with the external argument "-microprofile_enabled 0", or disabling it in the Editor console.禁用Microprofile该工具还可以节省多达 6 Gb RAM。这可以通过运行编辑器来完成外部论据"-microprofile_enabled 0",或在编辑器控制台中禁用它。

If you have crashes while generating a terrain, gradual adding layers one by one and generating can help finding a problem with the data. Or at least remove the vector data layer, because it may be very consuming.如果在生成地形时出现崩溃,逐步一层一层添加并生成可以帮助发现数据问题。或者至少删除矢量数据层,因为它可能非常消耗。

最新更新: 2023-11-08
Build: ()