元编程参考文档

高度图可视化

20 个节点

本页内容 20

应用颜色渐变

函数

重载 1/4

签名
应用颜色渐变(高度图: Scalar Field) -> Pixel Image
PixelImage ApplyColorRamp(ScalarField2D heightmap)

此节点没有文档说明。

参数

名称类型默认值说明
高度图Scalar Field—

返回

结果Pixel Image

重载 2/4

签名
应用颜色渐变 -> Pixel Image
    源场: Scalar Field
    渐变色标: IReadOnlyList<Color Stop>
PixelImage ApplyColorRamp(
    ScalarField2D sourceField,
    IReadOnlyList<ColorStop> colorStops)

Applies full range color ramp on a source field.

参数

名称类型默认值说明
源场Scalar Field—Source heightmap, mask, etc.
渐变色标IReadOnlyList<Color Stop>—

返回

结果Pixel Image

重载 3/4

签名
应用颜色渐变 -> Pixel Image
    源场: Scalar Field
    颜色渐变: Color Ramp
PixelImage ApplyColorRamp(
    ScalarField2D sourceField,
    ColorRamp colorRamp)

Applies a normalized color ramp to a source field using its own min/max range.

参数

名称类型默认值说明
源场Scalar Field—
颜色渐变Color Ramp—

返回

结果Pixel Image

重载 4/4

签名
应用颜色渐变 -> Pixel Image
    源场: Scalar Field
    颜色渐变: Color Ramp
    最小值: 数字
    最大值: 数字
PixelImage ApplyColorRamp(
    ScalarField2D sourceField,
    ColorRamp colorRamp,
    double minimumValue,
    double maximumValue)

Applies a normalized color ramp to a source field using an explicit value range.

参数

名称类型默认值说明
源场Scalar Field—
颜色渐变Color Ramp—
最小值数字—
最大值数字—

返回

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

应用带阴影的颜色渐变

函数

此节点没有文档说明。

重载 1/2

签名
应用带阴影的颜色渐变 -> Pixel Image
    高度图: Scalar Field
    阴影强度: 数字
PixelImage ApplyShadedColorRamp(
    ScalarField2D heightmap,
    double shadeStrength = 0.5)

参数

名称类型默认值说明
高度图Scalar Field—
阴影强度数字0.5

返回

结果Pixel Image

重载 2/2

签名
应用带阴影的颜色渐变 -> Pixel Image
    高度图: Scalar Field
    渐变色标: IReadOnlyList<Color Stop>
    阴影强度: 数字
    方位角(度): 数字
    高度角: 数字
PixelImage ApplyShadedColorRamp(
    ScalarField2D heightmap,
    IReadOnlyList<ColorStop> colorStops,
    double shadeStrength = 0.5,
    double azimuthDegrees = 315,
    double altitudeDegrees = 45)

参数

名称类型默认值说明
高度图Scalar Field—
渐变色标IReadOnlyList<Color Stop>—
阴影强度数字0.5
方位角(度)数字315
高度角数字45

返回

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

烘焙阴影图

函数

重载 1/2

签名
烘焙阴影图 -> Pixel Image
    高度图: Scalar Field
    太阳方向: Vector3
    分辨率比例: 整数
    太阳大小: 数字
    软阴影采样数: 整数
    并行计算: 真否
PixelImage BakeShadowMap(
    ScalarField2D heightmap,
    Vector3 sunDirection,
    int resolutionScale = 1,
    double sunSize = 0,
    int softShadowSamples = 32,
    bool parallelCompute = false)

Bakes a grayscale shadow map from a terrain scalar field.

参数

名称类型默认值说明
高度图Scalar Field—Source terrain height field.
太阳方向Vector3—Direction from a terrain point toward the sun. For example, Vector3.UnitZ represents a sun directly overhead.
分辨率比例整数1Output resolution multiplier. Values greater than one currently use bilinear height sampling to evaluate the higher-resolution output pixels.
太阳大小数字0Angular radius of the sun in degrees. Zero produces sharp shadows.
软阴影采样数整数32Number of sun-disc samples used when Sun Size is greater than zero.
并行计算真否FalseEnables row-level parallel processing. Gives big speed up on multi-core CPUs.

返回

结果Pixel Image

重载 2/2

签名
烘焙阴影图 -> Pixel Image
    高度图: Scalar Field
    地理坐标: Geographic Coordinate
    时间日期: DateTimeOffset
    分辨率比例: 整数
    太阳大小: 数字
    软阴影采样数: 整数
    并行计算: 真否
    高度图 Y 轴朝北: 真否
PixelImage BakeShadowMap(
    ScalarField2D heightmap,
    GeographicCoordinate geographicCoordinate,
    DateTimeOffset dateTime,
    int resolutionScale = 1,
    double sunSize = 0,
    int softShadowSamples = 32,
    bool parallelCompute = false,
    bool heightmapYPointsNorth = true)

Bakes a grayscale Earth sunlight shadow map for a geographic location and date.

参数

名称类型默认值说明
高度图Scalar Field—Source terrain height field.
地理坐标Geographic Coordinate—Geographic location represented by the terrain.
时间日期DateTimeOffset—Absolute date and time for which the Sun direction is calculated. The supplied UTC offset is honored.
分辨率比例整数1Output resolution multiplier. Values greater than one currently use bilinear height sampling to evaluate the higher-resolution output pixels.
太阳大小数字0Angular radius of the sun in degrees. Zero produces sharp shadows. The real Sun has an approximate angular radius of 0.27 degrees.
软阴影采样数整数32Number of sun-disc samples used when Sun Size is greater than zero.
并行计算真否FalseEnables row-level parallel processing. Gives big speed up on multi-core CPUs.
高度图 Y 轴朝北真否TrueTrue when increasing heightmap Y coordinates point north. Set to false for conventional north-up raster (DEM) data where row indices increase southward.

返回

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

烘焙可见性图

函数

重载 1/2

签名
烘焙可见性图 -> Scalar Field
    高度图: Scalar Field
    相机: Camera Specification
ScalarField2D BakeVisibilityMap(
    ScalarField2D heightmap,
    HeightmapCameraVisibilityMapBaker.CameraSpecification camera)

Bakes a terrain visibility mask using default bake settings.

参数

名称类型默认值说明
高度图Scalar Field—Source terrain height field.
相机Camera Specification—Camera used to determine terrain visibility.

返回

结果Scalar Field

重载 2/2

签名
烘焙可见性图 -> Scalar Field
    高度图: Scalar Field
    相机: Camera Specification
    设置: Visibility Map Bake Settings
ScalarField2D BakeVisibilityMap(
    ScalarField2D heightmap,
    HeightmapCameraVisibilityMapBaker.CameraSpecification camera,
    HeightmapCameraVisibilityMapBaker.VisibilityMapBakeSettings settings)

Bakes a terrain visibility mask using detailed bake settings.

参数

名称类型默认值说明
高度图Scalar Field—Source terrain height field.
相机Camera Specification—Camera used to determine terrain visibility.
设置Visibility Map Bake Settings—Visibility baking configuration.

返回

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

配置可见性相机

函数

Configures the camera a visibility map is baked for: where it stands, where it looks, and how wide it sees.

签名
配置可见性相机 -> Camera Specification
    位置: Vector3d
    前方: Vector3d
    水平视野角: 数字
    垂直视野角: 数字
    远平面: 数字
HeightmapCameraVisibilityMapBaker.CameraSpecification ConfigureVisibilityCamera(
    Vector3d position,
    Vector3d forward,
    double horizontalFieldOfView = 90,
    double verticalFieldOfView = 60,
    double farPlane = 10000)

参数

名称类型默认值说明
位置Vector3d—Where the camera stands, in terrain world space: rows run along +X and columns along +Y at the heightmap's physical scale, and heights are Z. To see the terrain from above, stand higher than its highest point.
前方Vector3d—The direction the camera looks. Looking across a terrain from its corner is a positive X and Y with a negative Z.
水平视野角数字90How wide the camera sees, in degrees.
垂直视野角数字60How tall the camera sees, in degrees.
远平面数字10000How far the camera sees, in world units.

返回

结果Camera Specification

备注

The camera's properties can only be set as it is constructed, and nodes cannot construct a type that way yet, so without this tool no graph could hand the baker a camera at all - Terrain Visibility Map failed every run with "Value cannot be null. (Parameter 'camera')". It is the same stand-in HeightmapGenerator.ConfigureHeightmapNoiseSettings is for noise settings. A perspective camera whose up is the terrain's up, which is what a person standing on or above a terrain is.

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

生成生物群系纹理

函数

Generates a biome texture image based on the heightmap data.

签名
生成生物群系纹理(高度图: Scalar Field) -> Pixel Image
PixelImage GenerateBiomeTexture(ScalarField2D heightmap)

参数

名称类型默认值说明
高度图Scalar Field—

返回

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

生成生物群系渐变纹理

函数

此节点没有文档说明。

签名
生成生物群系渐变纹理(高度图: Scalar Field) -> Pixel Image
PixelImage GenerateBiomeTextureGradient(ScalarField2D heightmap)

参数

名称类型默认值说明
高度图Scalar Field—

返回

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

生成法线贴图像素图像

函数

Generates a tangent-space normal map from a heightmap.

签名
生成法线贴图像素图像 -> Pixel Image
    高度图: Scalar Field
    法线强度: 数字
    使用物理比例: 真否
    反转绿色: 真否
PixelImage GenerateNormalMapPixelImage(
    ScalarField2D heightmap,
    double normalStrength = 1,
    bool usePhysicalScale = false,
    bool invertGreen = false)

参数

名称类型默认值说明
高度图Scalar Field—Source heightmap.
法线强度数字1Strength of the horizontal normal components.
使用物理比例真否FalseWhether gradient calculation uses the heightmap's PhysicalScale.
反转绿色真否FalseInverts the tangent-space Y/green channel for consumers using the opposite normal-map convention.

返回

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

获取蒙版范围

函数

此节点没有文档说明。

签名
获取蒙版范围(蒙版: Scalar Field) -> HeightmapVisualizationRoutines.MaskRange
HeightmapVisualizationRoutines.MaskRange GetMaskRange(ScalarField2D mask)

参数

名称类型默认值说明
蒙版Scalar Field—

返回

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

叠加等高线

函数

此节点没有文档说明。

签名
叠加等高线 -> Pixel Image
    基础图像: Pixel Image
    高度图: Scalar Field
    间隔: 数字
    线条颜色: 可选颜色
    不透明度: 数字
PixelImage OverlayContours(
    PixelImage baseImage,
    ScalarField2D heightmap,
    double interval,
    ColorElement? lineColor,
    double opacity = 1)

参数

名称类型默认值说明
基础图像Pixel Image—
高度图Scalar Field—
间隔数字—
线条颜色可选颜色—
不透明度数字1

返回

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

渲染带阴影的表面像素图像

函数

Renders a scalar field as a lit height surface using color-ramp tint, normal-based diffuse lighting, specular highlights, fresnel tint, and optional crest foam.

重载 1/2

签名
渲染带阴影的表面像素图像(源场: Scalar Field) -> Pixel Image
PixelImage RenderShadedSurfacePixelImage(ScalarField2D sourceField)

参数

名称类型默认值说明
源场Scalar Field—

返回

结果Pixel Image

重载 2/2

签名
渲染带阴影的表面像素图像 -> Pixel Image
    源场: Scalar Field
    设置: HeightmapVisualizationRoutines.SurfaceShadingSettings
PixelImage RenderShadedSurfacePixelImage(
    ScalarField2D sourceField,
    HeightmapVisualizationRoutines.SurfaceShadingSettings settings)

参数

名称类型默认值说明
源场Scalar Field—
设置HeightmapVisualizationRoutines.SurfaceShadingSettings—

返回

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

转为等高线图

函数

此节点没有文档说明。

签名
转为等高线图 -> Pixel Image
    高度图: Scalar Field
    间隔: 数字
    线条颜色: 可选颜色
    背景颜色: 可选颜色
PixelImage ToContourMap(
    ScalarField2D heightmap,
    double interval = 0.1,
    ColorElement? lineColor,
    ColorElement? backgroundColor)

参数

名称类型默认值说明
高度图Scalar Field—
间隔数字0.1
线条颜色可选颜色—
背景颜色可选颜色—

返回

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

转为灰度像素图像

函数

重载 1/2

签名
转为灰度像素图像 -> Pixel Image
    源场: Scalar Field
    最小值: 数字
    最大值: 数字
    反转: 真否
PixelImage ToGrayscalePixelImage(
    ScalarField2D sourceField,
    double minimumValue,
    double maximumValue,
    bool invert = false)

Converts a scalar field to grayscale using an explicit fixed value range.
Values outside the range are clamped.

参数

名称类型默认值说明
源场Scalar Field—
最小值数字—
最大值数字—
反转真否False

返回

结果Pixel Image

重载 2/2

签名
转为灰度像素图像(高度图: Scalar Field) -> Pixel Image
PixelImage ToGrayscalePixelImage(ScalarField2D heightmap)

此节点没有文档说明。

参数

名称类型默认值说明
高度图Scalar Field—

返回

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

转为热力图

函数

此节点没有文档说明。

签名
转为热力图(高度图: Scalar Field) -> Pixel Image
PixelImage ToHeatmap(ScalarField2D heightmap)

参数

名称类型默认值说明
高度图Scalar Field—

返回

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

转为山体阴影图

函数

此节点没有文档说明。

签名
转为山体阴影图 -> Pixel Image
    高度图: Scalar Field
    方位角(度): 数字
    高度角: 数字
    垂直夸张: 数字
PixelImage ToHillshade(
    ScalarField2D heightmap,
    double azimuthDegrees = 315,
    double altitudeDegrees = 45,
    double verticalExaggeration = 1)

参数

名称类型默认值说明
高度图Scalar Field—
方位角(度)数字315
高度角数字45
垂直夸张数字1

返回

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

转为法线贴图

函数

此节点没有文档说明。

签名
转为法线贴图(高度图: Scalar Field) -> Pixel Image
PixelImage ToNormalMap(ScalarField2D heightmap)

参数

名称类型默认值说明
高度图Scalar Field—

返回

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

转为坡度图

函数

此节点没有文档说明。

签名
转为坡度图 -> Pixel Image
    高度图: Scalar Field
    最大坡度(度): 数字
PixelImage ToSlopeMap(
    ScalarField2D heightmap,
    double maxSlopeDegrees = 60)

参数

名称类型默认值说明
高度图Scalar Field—
最大坡度(度)数字60

返回

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

转为体素空间图像

函数

重载 1/4

签名
转为体素空间图像 -> Pixel Image
    高度图: Scalar Field
    宽度: 整数
    高度: 整数
    相机: VoxelCamera
PixelImage ToVoxelSpaceImage(
    ScalarField2D heightmap,
    int width,
    int height,
    VoxelCamera camera)

Renders a VoxelSpace-style first-person terrain view into a PixelImage.
Camera X/Y are in heightmap pixel coordinates. Camera Height is in normalized 0..255 height units.

参数

名称类型默认值说明
高度图Scalar Field—
宽度整数—
高度整数—
相机VoxelCamera—

返回

结果Pixel Image

重载 2/4

签名
转为体素空间图像 -> Pixel Image
    高度图: Scalar Field
    颜色贴图: Pixel Image
    宽度: 整数
    高度: 整数
    相机: VoxelCamera
PixelImage ToVoxelSpaceImage(
    ScalarField2D heightmap,
    PixelImage colorMap,
    int width,
    int height,
    VoxelCamera camera)

Renders a VoxelSpace-style first-person terrain view into a PixelImage.
Camera X/Y are in heightmap pixel coordinates. Camera Height is in normalized 0..255 height units.

参数

名称类型默认值说明
高度图Scalar Field—
颜色贴图Pixel Image—
宽度整数—
高度整数—
相机VoxelCamera—

返回

结果Pixel Image

重载 3/4

签名
转为体素空间图像 -> Pixel Image
    高度图: Scalar Field
    宽度: 整数
    高度: 整数
    相机 X: 低精度数字
    相机 Y: 低精度数字
    相机高度: 低精度数字
    角度: 低精度数字
    地平线: 可选低精度数字
    距离: 低精度数字
PixelImage ToVoxelSpaceImage(
    ScalarField2D heightmap,
    int width,
    int height,
    float cameraX,
    float cameraY,
    float cameraHeight = 100f,
    float angle = 0f,
    float? horizon,
    float distance = 1000f)

Convenience overload that creates a camera from common parameters.
Camera X/Y are in heightmap pixel coordinates. Camera Height is in normalized 0..255 height units.

参数

名称类型默认值说明
高度图Scalar Field—
宽度整数—
高度整数—
相机 X低精度数字—
相机 Y低精度数字—
相机高度低精度数字100
角度低精度数字0
地平线可选低精度数字—
距离低精度数字1000

返回

结果Pixel Image

备注

Similar to Divooka.Terrains.VoxelSpaceRenderer.Renderers.VoxelRenderer.

重载 4/4

签名
转为体素空间图像 -> Pixel Image
    高度图: Scalar Field
    颜色贴图: Pixel Image
    宽度: 整数
    高度: 整数
    相机 X: 低精度数字
    相机 Y: 低精度数字
    相机高度: 低精度数字
    角度: 低精度数字
    地平线: 可选低精度数字
    距离: 低精度数字
PixelImage ToVoxelSpaceImage(
    ScalarField2D heightmap,
    PixelImage colorMap,
    int width,
    int height,
    float cameraX,
    float cameraY,
    float cameraHeight = 100f,
    float angle = 0f,
    float? horizon,
    float distance = 1000f)

Convenience overload with explicit color map.
Camera X/Y are in heightmap pixel coordinates. Camera Height is in normalized 0..255 height units.

参数

名称类型默认值说明
高度图Scalar Field—
颜色贴图Pixel Image—
宽度整数—
高度整数—
相机 X低精度数字—
相机 Y低精度数字—
相机高度低精度数字100
角度低精度数字0
地平线可选低精度数字—
距离低精度数字1000

返回

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

高程分层着色像素图像

函数

An alternative color theme.

签名
高程分层着色像素图像 -> Pixel Image
    高度图: Scalar Field
    反转: 真否
    海平面: 低精度数字
    渐变: IReadOnlyList<Color Stop>
PixelImage VisualizeHypsometricPixelImage(
    ScalarField2D heightmap,
    bool invert = false,
    float seaLevel = 0.35f,
    IReadOnlyList<ColorStop> ramp)

参数

名称类型默认值说明
高度图Scalar Field—
反转真否False
海平面低精度数字0.35
渐变IReadOnlyList<Color Stop>—

返回

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

把带阴影的表面写入像素

函数

Renders a row-major float height field directly into a tightly packed RGBA byte buffer.
Intended for realtime preview paths that should avoid PixelImage/ScalarField2D allocation per frame.

重载 1/2

签名
把带阴影的表面写入像素
    源数据行优先: 低精度数字数组
    宽度: 整数
    高度: 整数
    物理比例: 数字
    像素: 字节数组
    设置: HeightmapVisualizationRoutines.SurfaceShadingSettings
void WriteShadedSurfaceToPixels(
    float[] sourceRowMajor,
    int width,
    int height,
    double physicalScale,
    byte[] pixels,
    HeightmapVisualizationRoutines.SurfaceShadingSettings settings)

参数

名称类型默认值说明
源数据行优先低精度数字数组—
宽度整数—
高度整数—
物理比例数字—
像素字节数组—
设置HeightmapVisualizationRoutines.SurfaceShadingSettings—

备注

TODO: This function modifies incoming source. Refactor to return output instead.

重载 2/2

签名
把带阴影的表面写入像素
    源: 低精度数字数组数组
    宽度: 整数
    高度: 整数
    物理比例: 数字
    像素: 字节数组
    设置: HeightmapVisualizationRoutines.SurfaceShadingSettings
void WriteShadedSurfaceToPixels(
    float[][] source,
    int width,
    int height,
    double physicalScale,
    byte[] pixels,
    HeightmapVisualizationRoutines.SurfaceShadingSettings settings)

参数

名称类型默认值说明
源低精度数字数组数组—
宽度整数—
高度整数—
物理比例数字—
像素字节数组—
设置HeightmapVisualizationRoutines.SurfaceShadingSettings—

备注

TODO: This function modifies incoming source. Refactor to return output instead.

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