元編程參考文件

高度圖細節增強

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
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
高度圖細節增強
所屬包
程序化生成