元编程参考文档

程序化地形

可用

高度图:生成、侵蚀、滤波、着色、贴图和物体布置

Methodox Wiki 上的使用指南

40 个类别,共 527 个节点

所属发行版
元编程(教育版)元编程(专业版)
支持等级
第 2 级(拟定)
所属包
程序化生成
程序化生成

高度图地形、噪声、侵蚀、行星贴图与纹理,以及承载它们的三维网格与场景。

高度图操作

相加相加(就地)应用曲线应用蒙版Applies a series of HeightmapMasks to the Heightmap using a specified modification function.混合混合高度蒙版Creates a modified copy of a heightmap by applying a grayscale height mask using the specified blend mode.带蒙版混合计算流量累积图Calculates routed rainfall accumulation across the terrain.计算高度变化计算归一化高度变化Calculates pixel-space gradient magnitude and normalizes the result to 0-1.计算基于法线的陡峭度Calculates normal-derived steepness.计算法线计算物理高度变化计算归一化物理高度变化Calculates world-space gradient magnitude and normalizes the result to 0-1.计算坡度角(度)Calculates slope angle in degrees.计算坡度角(弧度)Calculates slope angle in radians.计算坡度图Calculates a derived slope/steepness map from a heightmap.计算地形湿度指数图Calculates raw Topographic Wetness Index from routed flow accumulation and terrain slope.计算湿度蒙版Creates an artist-friendly 0-1 wetness mask from Topographic Wetness Index percentiles.限制范围限制范围(就地)复制高度图合并蒙版Combines multiple Heightmap masks (value range 0-1) into a single union mask.对比度Adjusts height contrast relative to the current elevation range.对比度(就地)Adjusts height contrast relative to the current elevation range.创建森林蒙版Creates a forest suitability mask.创建局部起伏蒙版Creates a terrain flatness mask from local relief.创建径向蒙版创建积雪蒙版Creates a snow coverage mask from elevation, slope retention, and settling.创建水域蒙版Creates a combined water mask from routed rivers and filled-depression lakes.创建水面Simply mask out a water plane based on specified Water Level.裁剪Crops the source scalar field to the specified rectangular region.曲线调整Applies a normalized level adjustment transfer curve while preserving the current elevation range.曲线调整(就地)Applies a normalized level adjustment transfer curve while preserving the current elevation range.相除相除(就地)均衡化Redistributes values by percentile rank while preserving the current elevation range.均衡化(就地)Redistributes values by percentile rank while preserving the current elevation range.填充(就地)按高度筛选Filters the heightmap based on a minimum or maximum height rule with an optional fade.按坡度筛选Filters the heightmap based on slope range with an optional fade.按值筛选用 1 减Invert by subtracting from 1.反转范围生成排水Modifies terrain in place so non-outlet cells can drain toward an outlet.生成排水(就地)Modifies terrain in place so non-outlet cells can drain toward an outlet.生成梯田Creates a terraced copy while preserving the source elevation range.生成梯田(就地)Applies terrace shaping in place while preserving the current elevation range.相乘相乘(就地)取反Negates all values.归一化归一化(就地)Rescale entire height field to fit in height range.幂运算替换(就地)Replace data from flattened array.调整大小Resizes the source scalar field to the specified dimensions.平滑Useful on low-resolution imports.细分Creates a more densely subdivided scalar field while preserving its overall physical dimensions.细分(就地)Subdivides the target scalar field in place while preserving its overall physical dimensions.相减相减(就地)梯田化阈值化Creates a binary mask by converting values below the threshold to 0 and values at or above the threshold to 1.

地形侵蚀设置

创建地形侵蚀设置复制设置A copy that can be changed without affecting this instance.面积指数Drainage area exponent m.基准面Sea level, in metres.基岩休止角(度)Steepest stable angle of soft bedrock, in degrees.边界作为出口Whether the map border drains off the map.河道记忆How quickly the remembered discharge follows each pass (0..1).粗网格单元数The fluvial stage runs most of its time on a coarser grid whose longer side has this many cells, then refines at full resolution.沉积系数Dimensionless deposition coefficient G.沉积坡度Gradient (m/m) of the surface sediment builds when it fills a lake or closed basin, rising away from the outlet like a delta or alluvial plain.水滴容量Sediment capacity factor: how much a droplet can carry per unit of speed, slope and water.水滴密度Droplets spawned per square metre in each pass.水滴沉积率Fraction of excess sediment dropped per step.水滴每米蒸发率Water lost per metre travelled, as a fraction.水滴最大行程Longest distance a droplet may run from the tile it starts in, in metres.水滴轮数Number of droplet passes.水滴拾取率Fraction of spare capacity picked up per step.水滴半径Radius of the erosion brush, in metres.水滴强度Overall strength of droplet erosion and deposition, as a multiplier.时长(千年)Simulated geological time of the fluvial stage, in thousands of years.启用水滴阶段Run the droplet stage, which adds rills, gullies and small deposits on top of the fluvial landscape.启用河流阶段Run the fluvial stream-power stage, which carves the drainage network: dendritic valleys, sharp ridges, alluvial fans and filled lakes.启用崩塌阶段Run the talus stage, which slumps slopes steeper than the angle of repose into scree and debris aprons.可侵蚀性Erodibility K of the stream-power law, in m^(1-2m)/yr.精细步数How many full-resolution fluvial steps follow the coarse pass.坡面扩散率Hillslope creep diffusivity, in m²/yr.最大线程数Maximum number of threads; 0 uses every core.径流(米/年)Runoff per unit area, in metres per year, used to turn drainage area into discharge for the water depth map.泥沙可侵蚀性倍数How much more easily deposited sediment is eroded than bedrock, as a multiplier of the erodibility.种子Random seed of the droplet stage.坡度指数Slope exponent n.休止角(度)Angle of repose of loose material (deposits and debris), in degrees.崩塌迭代次数Upper bound on talus iterations.崩塌速率Fraction of the excess moved per talus iteration (0..1).时间步长(千年)Fluvial time step, in thousands of years.抬升速率(毫米/年)Tectonic uplift rate, in mm/yr, multiplied by the optional uplift map.

标量场

物理比例Meters per unit cell.标量场Initializes a new instance of the Heightmap class with the specified dimensions.相加Adds another heightmap to this heightmap, element-wise.应用Applies a custom transformation function to each height value in the heightmap.复制标量场Clones the heightmap, creating a deep copy.创建模板Creates a heightmap with same dimensions and attributes but initialized with fresh empty data.裁剪Crops the heightmap to the specified rectangular region.侵蚀笔刷Simple erosion压平笔刷Flattens the terrain within a brush area to a target height.列数Gets the width of the heightmap (number of columns).获取数据Row-major: height (y), width (x).获取高程是否已归一化Gets whether all values in this scalar field are valid normalized values in the inclusive 0..1 range.是否为正方形Occassionally useful due to output engine requirements - some usage scenarios require square maps.值Gets or sets the height value at the specified (x, y) coordinate.行数Gets the height of the heightmap (number of rows).用途An indicator what this heightmap is used for.获取世界深度获取世界宽度获取角度(度)Calculates the slope angle in degrees based on the gradient at a given point.获取平均高度Gets the average height value of the heightmap.获取颜色获取数组形式的数据Gets a copy of data.获取数组形式的数据(低精度)Gets a copy of data in floats.获取浮点值This is very slow!获取梯度Gets the gradient (partial derivatives) at the specified (x, y) coordinate.获取梯度大小获取灰度字节获取高度变化获取最大高度Gets the maximum height value in the heightmap.获取最小高度Gets the minimum height value in the heightmap.获取法线Gets the normal vector at the specified (x, y) coordinate.获取物理高度变化获取值Gets the height value at the specified (x, y) coordinate.获取 Z插值高度Interpolates the height value at the specified (x, y) coordinate using bilinear interpolation.噪声笔刷就地归一化并限制范围Normalizes every value in _heightData in place so the result is between 0.0 and 1.0 (as specified by Max Value).抬升降低笔刷Raises or lowers the terrain within a brush area.调整大小Resizes the heightmap to the specified dimensions using nearest neighbor scaling.逆时针旋转Rotates the heightmap data 90 degrees counterclockwise.顺时针旋转Rotates the heightmap data 90 degrees clockwise.双线性采样(限制边界)Bilinearly samples the field using grid coordinates and clamps samples at the outer border.世界坐标双线性采样(限制边界)Bilinearly samples the field using physical world coordinates.缩放高度Scales the heightmap vertically by the specified factor.设置值Sets the height value at the specified (x, y) coordinate.平滑Smooths the heightmap using a simple averaging filter.平滑笔刷Applies a smoothing operation within a brush area.细分Subdivides each heightmap cell into a finer grid while preserving the overall physical dimensions.汇总Returns a technical summary of the heightmap, one parameter per line.转为平铺数组Flattened array.转为平铺数组(低精度)Flattened array.转为像素图像作为颜色数据修改创建派生图从数组创建生成生物群系纹理生成生物群系渐变纹理获取坡度图用途标记Returns the canonical usage/term string for a slope map type.转为灰度像素图像验证物理比例

地形水体设置

地形水体设置水床深度(米)The bed the result gives under water is at least this far below the water surface, deepening from the shore over TerrainWaterSettings.BedSlopeMetres; where the ground is already deeper it is kept.水床坡度宽度(米)Distance from the shore over which the synthetic bed reaches about two thirds of TerrainWaterSettings.BedDepthMetres, metres.河道集水面积(平方千米)Catchment at which a channel starts, km², for the height above nearest drainage (HAND, Rennó et al.检测平水面Find water the survey recorded.填充洼地Fill closed depressions with water up to the height at which they spill (priority-flood, Barnes et al.平坦容差(米)How far a cell may lie from the level of the flat region it joins, metres.平水面抬升(米)How far the water surface of flat water sits above the flattened ground, metres, so the water's geometry does not coincide with the terrain's.平水面最小围合度The share of a flat region's rim that must rise above it for it to count as water: a lake or a river lies below its banks, a mesa top or a terrace lies above what surrounds it.洪水位(米)Flood every valley floor to this height above its channel, metres, as HAND flood mapping does with a river stage: the water surface is the channel's height plus the stage, and every cell draining to that channel lower than it is under water.湖泊集水面积比Catchment a lake needs per square metre of its surface to stay full, the ratio of evaporation from open water to runoff from its catchment: about 2 to 10 in wet mountains, 20 to 100 in semi-arid country, several hundred in a desert.湖泊填充比例How full each lake is, as a fraction of its depth from its lowest point to its spill height: 1 is brim-full, as a lake with an outlet stream is; less leaves the lower stand of a closed basin in a dry climate.河流最大爬升(米)The highest a reach may climb above the local valley floor to join two crossings, metres.最小平水面面积(平方米)The smallest flat region taken as water, m².最小湖泊面积(平方米)A depression holds a lake only if its water covers at least this much ground, m².最小湖泊深度(米)A depression holds a lake only if it is at least this deep below its spill height, metres.最小缺口深度(米)With automatic river ends, the least depth of a border notch below its sides for the river to cross the border through it, metres.河流深度(米)Water depth over the river's thalweg, metres.河流入口 UWhere the river enters, as a fraction of the map's width (columns) and depth (rows), 0..1. NaN, here or in the exit, finds the crossings in the border instead: every notch at least TerrainWaterSettings.MinimumNotchDepthMetres deep whose floor lies within TerrainWaterSettings.RiverFallMetres of the lowest one.河流入口 V河流出口 UWhere the river leaves, as a fraction of the map's width and depth, 0..1. With the entry given, the river runs between the two whatever lies between them.河流出口 V河流落差(米)How far the river falls across the map, metres: border notches whose floor lies higher than this above the lowest notch are side valleys, not the river.河流最大半宽(米)How far the river spreads from its thalweg over ground below its surface, metres.河面平滑半径(米)How far the river's surface is averaged over its own water, metres, 0 for not at all.仅从边界连通海水Only ground below sea level that connects to the map's border is sea; inland ground below it, as in a polder or the Dead Sea's basin, stays dry unless a lake fills it.海平面(米)Sea level, metres.岸线柔化宽度(米)The water mask falls from 1 to 0 over this distance across the shoreline, metres.过境河流A river crossing the map, fed from off it: the cheapest paths along the valley floor between the places it crosses the map's border, filled to TerrainWaterSettings.RiverDepthMetres.谷底高度(米)Height above drainage at which the valley-floor mask has fallen to 0, metres.河谷半径(米)Radius of the window whose lowest point is the local valley floor, metres.河谷容差(米)Height above the local valley floor that multiplies the path's cost by e, metres.湿润河岸距离(米)The wet-bank mask is 0 this far from the water, metres.湿润河岸高度(米)The wet-bank mask is 0 this high above the nearby water surface, metres: the height splash, seepage and floods keep wet.

单元格地形

高度图可视化

地形侵蚀结果

碎屑Material laid down by slumping (scree and debris aprons below steep slopes), metres of height.碎屑蒙版0..1 debris (talus) mask: 1 − exp(−debris / 1 m).沉积体积Volume laid down by water and slumping, m³.沉积Material laid down by water (fluvial deposits, filled lakes, droplet deposits), metres of height.沉积蒙版0..1 deposition mask: 1 − exp(−deposit / 2 m).流量Precipitation-weighted drainage area, m²: how much land drains through each cell.水滴阶段用时Time spent in the droplet stage.侵蚀体积Volume removed, m³.流出体积Volume carried off the map through outlets, m³.流向 XX component (columns, east) of the unit downhill flow direction.流向 YY component (rows, down the image) of the unit downhill flow direction.水流蒙版0..1 flow mask: logarithmic in drainage area, 0 at 1,000 m² and 1 at 10 km².河流阶段用时Time spent in the fluvial stage.硬度The rock hardness the erosion used (0 soft ..高度变化Final minus initial height, metres; negative where material was removed.高度变化蒙版0..1 height change: 0.5 unchanged, 0 at 10 m or more removed, 1 at 10 m or more added.高度图The eroded heightmap, metres.质量平衡误差Volume unaccounted for (net change + exported − uplifted), m³; near zero when mass is conserved.净体积变化Change of the terrain's total volume, m³.输出用时Time spent deriving the output maps.泥沙通量Sediment flux carried out of each cell, m³/yr.泥沙蒙版0..1 sediment mask: logarithmic in flux, 0 at 0.001 m³/yr and 1 at 10 m³/yr.崩塌迭代次数Talus iterations run.崩塌阶段用时Time spent in the talus stage.抬升体积Volume added by uplift, m³.水深Standing water depth, metres: lake depth below the spill height plus channel depth from hydraulic geometry (0.3·Q^0.4 with Q in m³/s).水域蒙版0..1 water mask: water depth, linear from 2 cm (0) to 1 m (1), so shallow channels show as well as lakes.侵蚀量Total material removed by all stages, metres of height.侵蚀量蒙版0..1 wear mask: 1 − exp(−wear / 5 m).湿度Topographic wetness index ln(a / tan β), dimensionless, with a the specific catchment area (m) and β the local slope.湿度蒙版0..1 wetness mask: wetness index, linear from 6 (0) to 14 (1).

地形分层

添加地形图层在图层栈顶上再加几层。坡向蒙版朝向某一方位的坡面:积雪久留的背阴北坡,或先干的向阳南坡。烘焙图层栈把图层栈烘焙成颜色、法线、粗糙度和高度贴图。模糊蒙版柔化蒙版的边缘。合并蒙版把两个蒙版合为一个:取交、取并、相减,或取较大、较小者。凹凸蒙版某一尺度上的凸起地面(山脊、台地顶)或凹陷地面(洼地、谷底、崖脚)。曲率蒙版地形在某一特征尺度上的曲率:平坦为 0.5,山脊趋近 1,沟谷趋近 0。场蒙版把一个场作为蒙版铺在地形上:手绘蒙版、侵蚀贴图或任何高度图形状的数据。全图蒙版处处都是。高度蒙版两个海拔之间的地面,在两侧按距离渐隐。输入蒙版按名称取用烘焙时给出的贴图:分析贴图中的 debris、deposition、wear、water 或 wetBanks,或场蒙版所起的名字。反转蒙版一减去蒙版。地形图层地形表面的一层:一种材质,铺在哪里,以及如何与下层相接。地形图层栈地形上的各层,第一层在最底:可以烘焙的表面。加载图层栈把保存的图层栈铺到地形上。蒙版亮度对比度提亮蒙版,并以中值为中心调整对比度。蒙版色阶拉伸蒙版:低值变为 0,高值变为 1。蒙版幂对蒙版取幂:大于 1 收窄,小于 1 扩展。蒙版阈值柔和的截断:低于一值为 0,高于另一值为 1。自然地形图层栈烘焙地形表面以自然风格铺设调色板所用的图层栈,可在烘焙前再加上自己的图层。近输入蒙版距某张烘焙贴图有值之处一定距离内的地面:沿水的沙滩、水边的岸地。近坡蒙版距坡度在两个角度之间之处一定距离内的地面:崖脚、崩落岩石所及之处。噪声蒙版以米为单位铺在地面上的分形噪声,0 到 1:让一种材质不至于整片同色的大块斑驳。保存图层栈把图层栈存为一份小小的 JSON 文档,以后可用“加载图层栈”铺到任何地形上。坡度蒙版坡度在两个角度之间的地面:平地、缓坡、悬崖。底层曲率蒙版下层材质的曲率,平坦为 0.5:石块的边缘、石缝。底层高度蒙版下层材质的高度,0 到 1:Mixer 的底层混合。湿度蒙版流过地形的水会汇集之处:地形湿度指数,谷底与洼地高。

单元格地形查询引擎

简单水文侵蚀结果

地貌

高度图流水线(过程式)

地形侵蚀

地形水体结果

高度图选择器

环境光遮蔽用途标记Usage of an ambient occlusion (sky visibility) field.坡向(度)用途标记Usage of an aspect field, in compass degrees.凸度用途标记Usage of a raw convexity field, in metres above the local mean.曲率用途标记Usage of a raw curvature field, in 1/metre.距离用途标记Usage of a distance field, in metres.计算环境光遮蔽Measures how much of the sky each cell sees, by marching the horizon in several directions: 1 in the open, darker in valleys, gorges and at the foot of cliffs.计算坡向(度)Gives the compass direction each slope faces (its downhill direction), in degrees clockwise from north.计算凸度Measures how far each cell stands above (positive) or below (negative) the Gaussian-weighted mean height around it, in metres.计算曲率Measures the surface curvature of a heightmap in 1/metre, positive on convex ground and negative on concave ground.计算距离Measures the exact straight-line distance in metres from every cell to the nearest cell of a mask.按坡向选择Selects slopes facing a compass direction: a 0..1 mask, for north-facing snow, sun-facing dry grass, moss on shaded sides.按凸度选择Selects ridges or gullies by convexity: a 0..1 mask that lights crests and darkens channels (Signed), or keeps one side only.按曲率选择Selects convex or concave ground by its curvature: a 0..1 mask.按距离带选择Selects a band of ground at a distance range from a mask: shore strips beside water, riverbank sediment, verges along roads, scree aprons below rock.

地形表面

地形分析贴图自然风格据以铺设调色板的分析贴图:侵蚀留下的岩屑、沉积与磨蚀,水面与湿润岸地。劣地地形调色板劣地:台地与缓坡上的草原,高处裸露的浅黄黏土,地势陡落处条带状的黏土与软砂岩崖壁,崖脚冲下的同样黏土,以及沟谷平地上龟裂的黏土。烘焙地形表面把调色板铺在地形上,烘焙成颜色、法线、粗糙度和高度贴图。地形调色板调色板:地貌中每种角色各一种材质。默认地形调色板来自素材库的温带山地调色板。荒漠地形调色板来自素材库的峡谷地区调色板:砾质沙地、砂岩崖壁、崩落岩石、淤泥色的河流。沙丘地形调色板石膏沙丘,如白沙:近乎白色的沙,丘间平地上龟裂的硬壳,积水处的灌丛。熔岩地形调色板新鲜熔岩,如基拉韦厄:灰黑色的玄武岩,平滑的熔岩流与粗糙的碎块,风化处少许草和蕨。素材库材质Divooka 素材库中的材质(Poly Haven 的 CC0 材质集),按真实尺寸。加载纹理集从按 Poly Haven 命名的贴图文件夹读取材质。自然纹理设置自然风格各角色的铺设位置,以米和度为单位。雨林地形调色板温带雨林:树下的落叶与林地,岩石和高处的苔藓,长满苔藓的灰色岩壁,水边的河砾与卵石。沼泽地形调色板沼泽:落叶下的泥地,较干高地上的草,水涨水落处裸露的湿泥与淤泥。地形材质由图像组成的材质:颜色、法线(OpenGL 约定,绿色朝上)、粗糙度、高度与环境光遮蔽中的任意几种。

高度图纹理采样器

高度图侵蚀(就地)

高度图生成器

高度图细节增强

地貌

高度图滤镜

高度图侵蚀

地形侵蚀蒙版

规则式高度图着色器

烘焙地形表面

地形散布

高度图读写

地形水体

高度图权重图

交互式高度图查看器

高度图效果

地形渲染

植被与散布

高度图网格化

单元格地形与高度图互转

单元格地形查询引擎工厂

地形河流

简单水文

真实地形