元编程参考文档

高度图细节增强

8 个节点

本页内容 8

细节幅度用途标记

函数

Usage of a detail amplitude map, in metres of RMS height at the reference scale.

签名
细节幅度用途标记() -> 文本
string HeightmapDataUsageTokenDetailAmplitude()

返回

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

添加分形细节

函数

在高度图来源数据的分辨率之下添加分形细节,按地形自身的粗糙度和坡度缩放。

签名
添加分形细节 -> Scalar Field
    高度图: Scalar Field
    源单元尺寸(米): 数字
    强度: 数字
    赫斯特指数: 数字
    细节风格: Heightmap Detail Style
    扭曲: 数字
    陡坡角度: 数字
    平坡角度: 数字
    平地保留比例: 数字
    静水坡度: 数字
    最小特征尺寸(米): 数字
    遮罩: Scalar Field
    种子: 整数
ScalarField2D AddFractalDetail(
    ScalarField2D heightmap,
    double sourceCellMetres = 0,
    double strength = 0.6,
    double hurst = 0.8,
    HeightmapDetailStyle style = HeightmapDetailStyle.Eroded,
    double warp = 0.1,
    double steepSlopeDegrees = 35,
    double flatSlopeDegrees = 3,
    double flatAmount = 0.3,
    double stillWaterSlopeDegrees = 0.5,
    double finestFeatureMetres = 0,
    ScalarField2D mask,
    int seed = 1337)

参数

名称类型默认值说明
高度图Scalar Field—Heights in metres; PhysicalScale in metres per cell.
源单元尺寸(米)数字0Cell size in metres of the data the heightmap came from (10 for a 1/3 arc-second survey); 0 uses the heightmap's own cell size.
强度数字0.6Multiplier of the detail: 1 restores the relief lidar shows and a 10 m survey lacks, 0 adds nothing; 0.6 reads best in renders.
赫斯特指数数字0.8Hurst exponent, 0..1: how fast the roughness falls with feature size. 0.8 suits most landscapes; lower is rougher at small scales, higher smoother.
细节风格Heightmap Detail Style侵蚀Fbm (rounded), Ridged (rock ribs) or Eroded (clean faces, rough tops and hollows).
扭曲数字0.1Domain warp as a fraction of the coarsest feature size; 0 disables it.
陡坡角度数字35Slope at and above which the detail is at full strength.
平坡角度数字3Slope at and below which the detail is reduced to Flat Amount.
平地保留比例数字0.3Fraction of the detail kept on flat ground, 0..1.
静水坡度数字0.5Below this slope (a hydro-flattened lake or river surface) the detail fades to nothing; 0 disables the cut.
最小特征尺寸(米)数字0Smallest feature size to add, in metres; 0 uses three output cells.
遮罩Scalar Field—Optional 0..1 mask the same size as the heightmap that scales the detail (e.g. 0 on water, roads or buildings).
种子整数1337Noise seed; the same seed gives the same detail.

返回

结果Scalar Field

备注

Octave feature sizes run from four times Source Cell Metres down to Finest Feature Metres (three output cells when 0), each about half the last. The amplitude of each octave is the local envelope (see HeightmapAmplification.CalculateDetailAmplitude) times a calibration constant times (feature size / coarsest size)^Hurst times Strength; at strength 1 the result matches the RMS relief that 1 m lidar has and a 10 m resampling of it lacks. The octaves are evaluated at gently domain-warped world positions and each is rotated, so the detail has no grid direction.
Give the source's true cell size when the heightmap has already been upsampled, otherwise the detail starts at the heightmap's own cell and adds nothing the source lacked.

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

添加地层

函数

添加沉积层理:陡峭的地面沿等高线断成台阶和短崖带,如同层状岩石风化那样,平坦的地面保持原样。

签名
添加地层 -> Scalar Field
    高度图: Scalar Field
    层厚(米): 数字
    强度: 数字
    薄层占比: 数字
    倾角: 数字
    倾向方位角: 数字
    起伏(米): 数字
    锚定高程: 数字
    遮罩: Scalar Field
    种子: 整数
ScalarField2D AddStrata(
    ScalarField2D heightmap,
    double layerThicknessMetres = 8,
    double strength = 0.6,
    double thinBedFraction = 0.2,
    double dipDegrees = 0,
    double dipAzimuthDegrees = 0,
    double warpMetres = 2,
    double anchorHeight = double.NaN,
    ScalarField2D mask,
    int seed = 1337)

参数

名称类型默认值说明
高度图Scalar Field—Heights in metres.
层厚(米)数字8Mean thickness of a bed in metres.
强度数字0.6How strongly beds terrace, 0..1: 0 leaves the surface unchanged; above about 0.75 the sharpest beds may fold a contour back on itself.
薄层占比数字0.2Share of the strength given to the thin beds, 0..1.
倾角数字0Dip of the bedding planes in degrees.
倾向方位角数字0Compass direction the beds dip toward, clockwise from north (up the map).
起伏(米)数字2Vertical waviness of the beds in metres, over a few hundred metres.
锚定高程数字NaNElevation in metres that the bedding leaves exactly in place (a river or lake level); NaN uses the lowest height on the map, which in a canyon is its river.
遮罩Scalar Field—Optional 0..1 mask the same size as the heightmap that scales the effect; keep its edges soft, since a hard edge becomes a step of up to the largest movement.
种子整数1337Seed of the bed sequence.

返回

结果Scalar Field

备注

Heights are remapped through a monotone function of elevation: within each bed, height changes slowly above and below a band where it changes quickly, so a slope breaks into benches and a cliff band per bed. Because only elevation is remapped, the ledges follow the contours exactly and the effect grows with slope by itself: a flat plateau or a lake is one elevation and moves as a whole, keeping its shape. Up to a strength of about 0.75 the remap never reverses the order of two heights, so it creates no pits or spikes. Bed thickness varies along a slow fractal of elevation and each bed has its own hardness (how strongly it terraces) and position of its cliff band; a second set of thin beds about a quarter as thick adds finer banding. The beds are warped and may dip, so they are not perfectly level. A cell moves by at most about a third of the bed thickness times the strength (about 1.5 m for 8 m beds at strength 0.6); on a 60° wall that sets ledges back by about a metre.
The remap is shifted so that ground at Anchor Height does not move at all: give the water level there, so a river or lake stays where the water surface expects it. Gating the bedding off on flat ground instead would turn the offset at the water's edge into a step along every bank.
Apply it to a smooth surface (after HeightmapAmplification.Upsample, before HeightmapAmplification.AddFractalDetail); applied after noise, the noise jitters which bed a cell falls in.

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

计算细节幅度

函数

以图的形式给出“添加分形细节”所用的局部幅度:参考尺寸(源单元的两倍)上细节的均方根高度,单位为米,尚未乘以强度。

签名
计算细节幅度 -> Scalar Field
    高度图: Scalar Field
    源单元尺寸(米): 数字
    陡坡角度: 数字
    平坡角度: 数字
    平地保留比例: 数字
    静水坡度: 数字
ScalarField2D CalculateDetailAmplitude(
    ScalarField2D heightmap,
    double sourceCellMetres = 0,
    double steepSlopeDegrees = 35,
    double flatSlopeDegrees = 3,
    double flatAmount = 0.3,
    double stillWaterSlopeDegrees = 0.5)

参数

名称类型默认值说明
高度图Scalar Field—Heights in metres.
源单元尺寸(米)数字0Cell size in metres of the data the heightmap came from; 0 uses the heightmap's own.
陡坡角度数字35Slope at and above which the amplitude is not reduced.
平坡角度数字3Slope at and below which the amplitude is reduced to Flat Amount.
平地保留比例数字0.3Fraction kept on flat ground.
静水坡度数字0.5Below this slope the amplitude fades to zero; 0 disables the cut.

返回

结果Scalar Field

备注

It combines two measures in quadrature: the roughness the source shows at its finest scale (the RMS of the source minus a one-cell blur, averaged over two cells), and a slope term, a twentieth of the height a plane of the local slope gains over the reference size, so that a smooth but steep face still roughens a little. On lidar the envelope correlates with the relief a 10 m resampling loses at 0.91 to 0.94. The result is weighted by the slope ramp and still-water cut and capped at half the reference size. Useful as a mask of where the terrain will change, or to tune the slope parameters before running the detail.

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

细化

函数

为渲染细化粗糙的高度图:平滑地上采样到目标单元尺寸,并在来源数据的分辨率之下添加分形细节。

签名
细化 -> Scalar Field
    源: Scalar Field
    目标单元尺寸(米): 数字
    细节强度: 数字
    种子: 整数
    赫斯特指数: 数字
    细节风格: Heightmap Detail Style
    插值方式: Heightmap Upsampling Kernel
    遮罩: Scalar Field
    地层厚度(米): 数字
    地层强度: 数字
ScalarField2D Refine(
    ScalarField2D source,
    double targetCellMetres = 1,
    double detailStrength = 0.6,
    int seed = 1337,
    double hurst = 0.8,
    HeightmapDetailStyle style = HeightmapDetailStyle.Eroded,
    HeightmapUpsamplingKernel kernel = HeightmapUpsamplingKernel.MonotoneCubic,
    ScalarField2D mask,
    double strataThicknessMetres = 0,
    double strataStrength = 0.6)

参数

名称类型默认值说明
源Scalar Field—Heightmap as surveyed, heights and PhysicalScale in metres.
目标单元尺寸(米)数字1Cell size of the result in metres.
细节强度数字0.6Multiplier of the added detail: 1 restores the relief lidar shows and a 10 m survey lacks, 0 adds none; 0.6 reads best in renders.
种子整数1337Noise seed.
赫斯特指数数字0.8Hurst exponent of the detail, 0..1; 0.8 suits most landscapes.
细节风格Heightmap Detail Style侵蚀Fbm, Ridged or Eroded detail.
插值方式Heightmap Upsampling Kernel单调三次Upsampling kernel; MonotoneCubic does not overshoot at cliffs.
遮罩Scalar Field—Optional 0..1 detail mask at the source's resolution (e.g. 0 on water); it is upsampled bilinearly.
地层厚度(米)数字0Mean bed thickness for HeightmapAmplification.AddStrata, applied between the upsample and the detail; 0 (the default) adds no bedding. Use it for layered sedimentary rock: canyons, mesas, badlands.
地层强度数字0.6Strength of the bedding, 0..1.

返回

结果Scalar Field

备注

The source's cell size is taken as the resolution of its information, so give the heightmap as surveyed (a 10 m model at 10 m cells), not one already upsampled. With Detail Strength 0 this is just HeightmapAmplification.Upsample. For layered rock give a bed thickness (8 to 12 m, with detail strength nearer 0.4); for downslope streaks follow with a short erosion, see the class remarks.

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

重采样

函数

在同一地面范围内把高度图重采样为指定的列数和行数。

签名
重采样 -> Scalar Field
    源: Scalar Field
    列数: 整数
    行数: 整数
    插值方式: Heightmap Upsampling Kernel
ScalarField2D Resample(
    ScalarField2D source,
    int columns,
    int rows,
    HeightmapUpsamplingKernel kernel = HeightmapUpsamplingKernel.MonotoneCubic)

参数

名称类型默认值说明
源Scalar Field—Heightmap to resample.
列数整数—Columns of the result.
行数整数—Rows of the result.
插值方式Heightmap Upsampling Kernel单调三次Interpolation; see HeightmapAmplification.Upsample.

返回

结果Scalar Field

备注

PhysicalScale becomes the source width in metres divided by Columns; when the aspect ratio changes, the rows are stretched to the same extent and the cells are no longer square, which PhysicalScale cannot describe, so keep the aspect ratio for heightmaps.

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

上采样

函数

把高度图重采样到以米为单位的更细单元尺寸,覆盖的地面范围不变。

签名
上采样 -> Scalar Field
    源: Scalar Field
    目标单元尺寸(米): 数字
    插值方式: Heightmap Upsampling Kernel
ScalarField2D Upsample(
    ScalarField2D source,
    double targetCellMetres = 1,
    HeightmapUpsamplingKernel kernel = HeightmapUpsamplingKernel.MonotoneCubic)

参数

名称类型默认值说明
源Scalar Field—Heightmap to resample; its PhysicalScale must be metres per cell.
目标单元尺寸(米)数字1Cell size of the result in metres.
插值方式Heightmap Upsampling Kernel单调三次Interpolation: MonotoneCubic (smooth, no overshoot; recommended), CatmullRom (smooth, rings at cliffs) or Bilinear (faceted).

返回

结果Scalar Field

备注

The output covers the same ground: its width in cells is the source's width in metres divided by Target Cell Metres, rounded, and its PhysicalScale is adjusted so the extent is exact. Samples sit at cell centres, as ScalarField2D.SampleWorldBilinearClamped assumes. Within half a source cell of the border the cubic kernels continue the edge slope rather than flattening. A coarser target is allowed; the source is then blurred first so it does not alias.

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

按倍数上采样

函数

按倍数重采样高度图(2 表示每条边上的单元数加倍),覆盖的地面范围不变。

签名
按倍数上采样 -> Scalar Field
    源: Scalar Field
    倍数: 数字
    插值方式: Heightmap Upsampling Kernel
ScalarField2D UpsampleByFactor(
    ScalarField2D source,
    double factor = 4,
    HeightmapUpsamplingKernel kernel = HeightmapUpsamplingKernel.MonotoneCubic)

参数

名称类型默认值说明
源Scalar Field—Heightmap to resample.
倍数数字4Ratio of the source cell size to the result's; need not be a whole number.
插值方式Heightmap Upsampling Kernel单调三次Interpolation; see HeightmapAmplification.Upsample.

返回

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