元编程参考文档

网格材质

9 个节点

本页内容 9

烘焙网格贴图

函数

Bakes a model's maps into its texture coordinates: ambient occlusion and thickness by tracing rays against the model, curvature from how its surface bends, and its position, world-space normal and parts.

签名
烘焙网格贴图 -> Mesh Maps
    网格: MaterialMesh
    尺寸: 整数
    采样数: 整数
    遮蔽距离: 数字
MeshMapSet BakeMeshMaps(
    MaterialMesh mesh,
    int size = 512,
    int samples = 48,
    double occlusionDistance = 0.25)

参数

名称类型默认值说明
网格MaterialMesh—The model, unwrapped.
尺寸整数512The maps' width and height in pixels.
采样数整数48Rays per pixel for occlusion and thickness; more is smoother and slower.
遮蔽距离数字0.25How far occlusion looks, as a share of the model's size.

返回

结果Mesh Maps
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理

加载网格

函数

A model read from an OBJ, glTF or GLB file: its triangles, normals and first texture coordinates. It must already be unwrapped.

签名
加载网格(路径: 文本) -> MaterialMesh
MaterialMesh LoadMesh(string path)

参数

名称类型默认值说明
路径文本—The model file.

返回

结果MaterialMesh
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理

按朝向生成蒙版

函数

A mask from which way the model's surface faces: white where it faces the direction, falling off over the spread. Moss and snow on upward faces, drips under overhangs.

签名
按朝向生成蒙版 -> Texture
    烘焙贴图: Mesh Maps
    方向: Facing Direction
    展开范围: 数字
    对比度: 数字
Texture MaskFromDirection(
    MeshMapSet maps,
    FacingDirection direction = FacingDirection.Up,
    double spread = 0.5,
    double contrast = 0.5)

参数

名称类型默认值说明
烘焙贴图Mesh Maps—The baked maps.
方向Facing Direction上The direction that is white.
展开范围数字0.5How far round from the direction the mask reaches, 0 to 1.
对比度数字0.5How hard its edge is, 0 to 1.

返回

结果Texture
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理

按高度生成蒙版

函数

A mask from height on the model: white below a level, black above, softened - rising damp, mud splashed at a base, a tide line.

签名
按高度生成蒙版 -> Texture
    烘焙贴图: Mesh Maps
    水位: 数字
    柔和度: 数字
    反转: 真否
Texture MaskFromHeight(
    MeshMapSet maps,
    double level = 0.25,
    double softness = 0.1,
    bool invert = false)

参数

名称类型默认值说明
烘焙贴图Mesh Maps—The baked maps.
水位数字0.25The level as a share of the model's height, 0 at its bottom.
柔和度数字0.1How gradual the change is.
反转真否FalseWhite above the level instead.

返回

结果Texture
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理

网格贴图通道

函数

The individual baked maps.

签名
网格贴图通道(烘焙贴图: Mesh Maps) -> (结果: Texture, 曲率: Texture, 位置: Texture, 世界法线: Texture, 厚度: Texture, 部件编号: Texture)
Texture MeshMapChannels(
    MeshMapSet maps,
    out Texture curvature,
    out Texture position,
    out Texture worldNormal,
    out Texture thickness,
    out Texture partId)

参数

名称类型默认值说明
烘焙贴图Mesh Maps—The baked maps.

返回

结果Texture
曲率Texture
位置Texture
世界法线Texture
厚度Texture
部件编号Texture
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理

在网格上预览

函数

A material rendered on a model, the camera placed to fit the model.

签名
在网格上预览 -> Pixel Image
    网格: MaterialMesh
    材质: PBR Material
    环境: PreviewEnvironment
    尺寸: 整数
    旋转: 数字
    起伏: PreviewRelief
PixelImage PreviewOnMesh(
    MaterialMesh mesh,
    PbrMaterial material,
    PreviewEnvironment environment = PreviewEnvironment.Studio,
    int size = 512,
    double rotation = 30,
    PreviewRelief relief = PreviewRelief.Parallax)

参数

名称类型默认值说明
网格MaterialMesh—The model.
材质PBR Material—The material, in the model's texture coordinates (from a layer stack or a triplanar projection).
环境PreviewEnvironment摄影棚The lighting.
尺寸整数512The picture's width and height in pixels.
旋转数字30Turns the model, in degrees.
起伏PreviewRelief视差How the material's height shows. Parallax works on any model; displacement moves the model's own vertices, so it needs a finely divided one.

返回

结果Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理

示例网格

函数

One of the sample shapes, unwrapped so that every point of its surface has its own texture coordinates: a model to bake and texture without leaving the graph.

签名
示例网格(形状: PreviewShape, 细分程度: 整数) -> MaterialMesh
MaterialMesh SampleMesh(
    PreviewShape shape = PreviewShape.RoundedBox,
    int detail = 64)

参数

名称类型默认值说明
形状PreviewShape圆角立方体The shape.
细分程度整数64How finely it is divided.

返回

结果MaterialMesh
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理

三角形数

函数

How many triangles a mesh has.

签名
三角形数(网格: MaterialMesh) -> 整数
int TriangleCount(MaterialMesh mesh)

参数

名称类型默认值说明
网格MaterialMesh—The mesh.

返回

结果整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理

三平面投射

函数

Projects a tiling material onto a model from three sides (triplanar), so it needs no seams in the model's own layout: each side of the model takes the projection facing it, blended where they meet. The result is laid out in the model's texture coordinates, ready for a layer stack.

签名
三平面投射 -> PBR Material
    材质: PBR Material
    烘焙贴图: Mesh Maps
    单块尺寸(米): 数字
    锐利度: 数字
PbrMaterial TriplanarProject(
    PbrMaterial material,
    MeshMapSet maps,
    double tileMetres = 0.5,
    double sharpness = 4)

参数

名称类型默认值说明
材质PBR Material—The tiling material.
烘焙贴图Mesh Maps—The model's baked maps.
单块尺寸(米)数字0.5The width one tile covers on the model, in metres.
锐利度数字4How narrow the blend between sides is: 1 soft, 8 nearly hard.

返回

结果PBR Material
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
网格材质
所属包
图像处理