高度图权重图
3 个节点
本页内容 3
计算材质编号
函数Gives each cell the index of its heaviest layer: a material ID map for engines and shaders that take one material per cell.
计算材质编号 -> Scalar Field
权重: Scalar Field 数组
归一化到 0 至 1: 真否ScalarField2D CalculateMaterialId(
ScalarField2D[] weights,
bool normalizeToUnitRange = false)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 权重 | Scalar Field 数组 | — | Layer weights or masks, all the same size. |
| 归一化到 0 至 1 | 真否 | False | False for the raw index (0, 1, 2, ...); true to divide by the last index so the map views as a 0..1 greyscale. |
返回
| 结果 | Scalar Field |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 高度图权重图
- 所属包
- 程序化生成
归一化权重
函数Converts material masks into layer weights that sum to 1 at every cell.
归一化权重 -> Scalar Field 数组
蒙版: Scalar Field 数组
分层: 真否
包含基础图层: 真否
对比度: 数字ScalarField2D[] NormalizeWeights(
ScalarField2D[] masks,
bool layered = true,
bool includeBaseLayer = true,
double contrast = 1)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 蒙版 | Scalar Field 数组 | — | Material masks in 0..1, bottom layer first, all the same size. |
| 分层 | 真否 | True | True to stack masks in order, false to share overlaps proportionally. |
| 包含基础图层 | 真否 | True | True to add a remainder layer at index 0 of the output. |
| 对比度 | 数字 | 1 | Exponent applied to every mask first; above 1 sharpens transitions between layers, below 1 widens them. |
返回
| 结果 | Scalar Field 数组 |
备注
Masks are given bottom first: each later mask is a layer above the earlier ones. Layered, a layer covers the layers below it by its own weight, the way paint layers stack (a cell with rock 0.8 over grass 1 is 80 % rock, 20 % grass). Not layered, overlapping masks share the cell in proportion to their values. With a base layer, whatever no mask claims goes to an extra layer placed first in the output; without one, the bottom mask takes it (layered) or the masks are scaled up to fill the cell (not layered, split equally where every mask is 0).
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 高度图权重图
- 所属包
- 程序化生成
打包权重
函数Packs layer weights four to an image, in the red, green, blue and alpha channels, the layout terrain engines read splatmaps in.
打包权重(权重: Scalar Field 数组) -> Pixel Image 数组
PixelImage[] PackWeights(ScalarField2D[] weights)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 权重 | Scalar Field 数组 | — | Layer weights, normally from HeightmapSplatmaps.NormalizeWeights. |
返回
| 结果 | Pixel Image 数组 |
备注
Layer i goes to image i / 4, channel i % 4 (R, G, B, A); unused channels of the last image are 0. Bytes are rounded so that, where the weights sum to 1, the channels of all the images together sum to exactly 255 (largest-remainder rounding), so no cell loses or gains coverage to rounding.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 高度图权重图
- 所属包
- 程序化生成