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版本才能使用它。

See Also另请参阅#

观看这段视频,来自Sandworm地形生成系列视频教程:

A Mask can be useful in two ways:蒙版可以是有用的在两个方面:

  • Detail specifying where the additional features (such as rocks, sand, etc.) are located on the primary surface. Detail指定附加特征(如岩石、沙子等)位于主表面的位置。
  • Mask to identify where to generate grass and trees.蒙版以确定在哪里生成草和树

You are already experienced enough to add an asset as a mask on your own. Let's add the asset sw_georeferenced/landcover/landcover_mask.tif and click Preview.您已经有足够的经验添加资源作为自己的蒙版。 让我们添加资源 sw_georeferenced/landcover/landcover_mask.tif 并单击 Preview

You can already click Create Mask, and this mask will be added to Terrain Sources. Any further changes you make in this source will be saved automatically.您已经可以单击Create Mask,这个蒙版将被添加到Terrain Sources。您在此源代码中所做的任何进一步更改都将被自动保存。

Specifying Mask Filters指定蒙版过滤器#

Filters are used to pick specific data from the mask source. At least one filter is required to make the mask useful.过滤器 用于从蒙版源中挑选特定数据。 至少需要一个过滤器才能使蒙版有用。

Let's add a filter: select the filter type.让我们添加一个过滤器:选择过滤器类型。

We are going to use this mask to generate trees. Apparently, this area is marked green in the landcover data. We can set the filter either as Indexed, or as Single Channel and select the green value. In our case, the result will be identical.我们将使用这个蒙版生成树。 显然,该区域在土地覆盖数据中被标记为绿色。 我们可以将过滤器设置为 IndexedSingle Channel 并选择绿色值。 在我们的例子中,结果将是相同的。

Let's add one more source from the assets to this mask and set a color filter.让我们从资源中再添加一个源到蒙版中,并设置一个颜色滤镜。

  1. In the same mask (i.e. don't create a new mask), click the Add Source(s) button and select Assets.在相同的蒙版(即不创建一个新蒙版),单击Add Source(s)按钮并选择Assets
  2. Select the sw_georeferenced/img/sw_1mpx_img_6.tif file and click OK. The preview will be updated. Let's zoom in to this source in the Map.选择sw_georeferenced/img/sw_1mpx_img_6.tif文件并单击OK。预览版将会更新。让我们放大地图上的这个源。

  3. Set the filter type to Color and click on the white color to open the color settings.过滤器类型设置为Color和点击白色打开颜色设置。
  4. Click the Pick Screen Color button and click on the dark-green color on the preview.单击Pick Screen Color按钮并单击预览中的深绿色。

    Click Apply to apply the picked color and OK to close the color settings window.单击Apply应用挑选颜色和OK关闭颜色设置窗口。

  5. Set Range to some value to allow for some color variation along the color palette.Range设置为某个值,以允许沿着调色板进行一些颜色变化。

This is it. Now if we generate trees using this mask they will be dispersed in the areas marked green and additionally in the dark-green areas of the added imagery.就这样。现在如果我们生成树使用这个蒙版他们将分散的区域标记的绿色和深绿色的另外区域添加照片。

Generated Mask生成的蒙版#

The generated mask is available as a detail of the Terrain object:生成的蒙版可用作 Terrain 对象的细节:

Mask in Detail of Landscape TerrainLandscape Terrain 细节的蒙版

Mask in Detail of Terrain GlobalTerrain Global 细节的蒙版

To see how the mask is applied to the terrain, toggle it in Helpers.要查看蒙版是如何应用到地形的,在Helpers中切换它。

The mask is also available for generating vegetation in Sandworm.该蒙版也可用于 Sandworm 中的生成植被

Mask in Vegetation ObjectVegetation对象中的蒙版

What Else还有什么#

  • Check the article on the mask for a more detailed description of parameters.查看关于蒙版的文章,以获得参数的更详细描述。
  • Read about configuring details of Object Landscape Terrain.阅读关于配置Object Landscape Terrain细节
  • See the video tutorial on configuring details of Object Terrain Global.关于配置Object Terrain Global的细节,请参阅视频教程
  • Read about indexed colors, for example on Wikipedia.阅读索引颜色,例如在 Wikipedia 上。
最新更新: 2023-04-13
Build: ()