元编程参考文档

高度图滤镜

7 个节点

本页内容 7

扭曲

函数

Warps a field by two displacement fields, one for each axis, with a maximum displacement in metres.

签名
扭曲 -> Scalar Field
    源: Scalar Field
    X 位移: Scalar Field
    Y 位移: Scalar Field
    幅度(米): 数字
    以 0.5 为中心: 真否
ScalarField2D Distort(
    ScalarField2D source,
    ScalarField2D displacementX,
    ScalarField2D displacementY,
    double amplitudeMetres = 20,
    bool centredAtHalf = true)

参数

名称类型默认值说明
源Scalar Field—Field to warp.
X 位移Scalar Field—Displacement along X (columns), the same size as the source.
Y 位移Scalar Field—Displacement along Y (rows), the same size as the source.
幅度(米)数字20Distance in metres a displacement value of 1 moves the sample.
以 0.5 为中心真否TrueTrue for displacement fields in 0..1 (masks, normalised noise), where 0.5 means no movement and 0 and 1 move by minus and plus the amplitude; false when the fields are already signed, centred on zero.

返回

结果Scalar Field

备注

Each output cell reads the source at its own position plus (dx, dy) × amplitude, bilinearly, clamped at the border. Distorting a selector mask by a noise or by the terrain itself removes the grid-straight edges thresholds leave behind; use HeightmapFilters.DistortByNoise when no displacement fields are at hand.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
高度图滤镜
所属包
程序化生成

噪声扭曲

函数

Warps a field by a smooth fractal noise, with the noise's feature size and the warp's reach in metres.

签名
噪声扭曲 -> Scalar Field
    源: Scalar Field
    幅度(米): 数字
    特征尺寸(米): 数字
    种子: 整数
    倍频程数: 整数
ScalarField2D DistortByNoise(
    ScalarField2D source,
    double amplitudeMetres = 20,
    double featureSizeMetres = 200,
    int seed = 1337,
    int octaves = 3)

参数

名称类型默认值说明
源Scalar Field—Field to warp.
幅度(米)数字20Largest distance in metres a sample moves.
特征尺寸(米)数字200Size in metres of the noise's largest features; small values fray edges, large values bend them.
种子整数1337Noise seed.
倍频程数整数3Fractal octaves; more adds finer fraying.

返回

结果Scalar Field

备注

The noise is evaluated in world metres, so a 2k and a 1k copy of the same terrain are warped alike. The X and Y displacements use independent seeds.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
高度图滤镜
所属包
程序化生成

扩展

函数

Grows or shrinks the bright parts of a mask (or the high parts of a heightmap) by a radius in metres, with a round footprint.

签名
扩展 -> Scalar Field
    源: Scalar Field
    半径(米): 数字
    方式: Heightmap Expander Mode
    柔化(米): 数字
ScalarField2D Expand(
    ScalarField2D source,
    double radiusMetres = 10,
    HeightmapExpanderMode mode = HeightmapExpanderMode.Grow,
    double softnessMetres = 0)

参数

名称类型默认值说明
源Scalar Field—Mask or field to expand.
半径(米)数字10Radius of the disc in metres. Below half a cell the source is returned unchanged.
方式Heightmap Expander Mode扩张Grow (maximum) or Shrink (minimum).
柔化(米)数字0Optional Gaussian blur in metres applied afterwards, so the new edge fades instead of stepping; 0 keeps the edge hard.

返回

结果Scalar Field

备注

Grow takes the maximum within a disc around each cell (morphological dilation), Shrink the minimum (erosion); grey values are kept, so a soft mask stays soft. Typical uses: spread a rock mask a few metres onto the scree below it, pull grass back from cliff edges, close small holes (grow then shrink) or remove specks (shrink then grow).

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
高度图滤镜
所属包
程序化生成

翻转

函数

Mirrors a field left-right, top-bottom, or both.

签名
翻转(源: Scalar Field, 水平: 真否, 垂直: 真否) -> Scalar Field
ScalarField2D Flip(
    ScalarField2D source,
    bool horizontal = true,
    bool vertical = false)

参数

名称类型默认值说明
源Scalar Field—Field to mirror.
水平真否TrueMirror left-right (reverse each row).
垂直真否FalseMirror top-bottom (reverse the order of rows).

返回

结果Scalar Field
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
高度图滤镜
所属包
程序化生成

高斯模糊

函数

Smooths a field with a Gaussian whose standard deviation is given in metres.

签名
高斯模糊(源: Scalar Field, 标准差(米): 数字) -> Scalar Field
ScalarField2D GaussianBlur(
    ScalarField2D source,
    double sigmaMetres = 10)

参数

名称类型默认值说明
源Scalar Field—Field to blur.
标准差(米)数字10Standard deviation of the Gaussian in metres. Features much smaller than this disappear; zero returns a copy.

返回

结果Scalar Field

备注

Unlike HeightmapOperations.Smooth (a box of a radius in cells) this is round, has no blocky ringing, and keeps its size in metres when the resolution changes. The kernel reaches three standard deviations.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
高度图滤镜
所属包
程序化生成

高通

函数

Keeps only the detail smaller than a size in metres: the field minus its Gaussian blur.

签名
高通(源: Scalar Field, 标准差(米): 数字) -> Scalar Field
ScalarField2D HighPass(
    ScalarField2D source,
    double sigmaMetres = 20)

参数

名称类型默认值说明
源Scalar Field—Field to filter.
标准差(米)数字20Standard deviation in metres of the blur that is subtracted; larger keeps broader features.

返回

结果Scalar Field

备注

The result is centred on zero and in the source's units (metres for a heightmap): positive on bumps and crests narrower than about the given size, negative in dips. Feed it to HeightmapOperations.Normalize or a selector to make a mask.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
高度图滤镜
所属包
程序化生成

锐化

函数

Exaggerates detail smaller than a size in metres (unsharp masking): source + amount × high-pass.

签名
锐化 -> Scalar Field
    源: Scalar Field
    标准差(米): 数字
    数量: 数字
ScalarField2D Sharpen(
    ScalarField2D source,
    double sigmaMetres = 20,
    double amount = 1)

参数

名称类型默认值说明
源Scalar Field—Field to sharpen.
标准差(米)数字20Standard deviation in metres separating detail from form.
数量数字1How much of the detail to add again; 0 returns the source, 1 doubles the detail, negative values soften.

返回

结果Scalar Field
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
高度图滤镜
所属包
程序化生成