元编程参考文档

纹理来源

8 个节点

本页内容 8

图像作为颜色

函数

A picture as a colour texture: an 8-bit picture decoded from sRGB to linear light, an HDR picture taken as it is. For a picture of colour - a photograph, a hand-painted texture.

签名
图像作为颜色(图像: I Pixel Image Sampler, 尺寸: 整数) -> Texture
Texture ImageAsColor(IPixelImageSampler image, int size = 0)

参数

名称类型默认值说明
图像I Pixel Image Sampler—The picture.
尺寸整数0Resampled to this size; 0 keeps the picture's own size.

返回

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

图像作为数据

函数

A picture as data: its grey values taken as numbers from 0 to 1 with no decoding. For a picture of a height, a mask or a roughness map.

签名
图像作为数据(图像: I Pixel Image Sampler, 尺寸: 整数) -> Texture
Texture ImageAsData(IPixelImageSampler image, int size = 0)

参数

名称类型默认值说明
图像I Pixel Image Sampler—The picture.
尺寸整数0Resampled to this size; 0 keeps the picture's own size.

返回

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

图像作为法线

函数

A normal map picture as a normal texture: its colours taken as the vector's components with no decoding.

签名
图像作为法线(图像: Pixel Image, DirectX 约定: 真否) -> Texture
Texture ImageAsNormal(PixelImage image, bool directX = false)

参数

名称类型默认值说明
图像Pixel Image—The normal map.
DirectX 约定真否FalseWhether the picture follows DirectX's convention (green pointing down), which is flipped here to the OpenGL convention glTF uses.

返回

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

线性渐变

函数

A ramp from 0 to 1 across the texture, repeating a whole number of times so it tiles; mirrored, it rises and falls back instead of jumping.

签名
线性渐变 -> Texture
    方向: Gradient Direction
    重复次数: 整数
    镜像: 真否
    尺寸: 整数
Texture LinearGradient(
    GradientDirection direction = GradientDirection.Horizontal,
    int repeats = 1,
    bool mirrored = false,
    int size = 1024)

参数

名称类型默认值说明
方向Gradient Direction水平Which way the ramp runs.
重复次数整数1How many times the ramp repeats across the texture.
镜像真否FalseRise and fall (a triangle) rather than rise and jump back (a saw).
尺寸整数1024Width and height in pixels.

返回

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

径向渐变

函数

A round gradient: 1 at the centre falling to 0 at the radius, measured across the tile's edges so it tiles.

签名
径向渐变 -> Texture
    中心 X: 数字
    中心 Y: 数字
    半径: 数字
    尺寸: 整数
Texture RadialGradient(
    double centerX = 0.5,
    double centerY = 0.5,
    double radius = 0.5,
    int size = 1024)

参数

名称类型默认值说明
中心 X数字0.5The centre across, 0 to 1.
中心 Y数字0.5The centre down, 0 to 1.
半径数字0.5Where it reaches 0, as a share of the texture's width.
尺寸整数1024Width and height in pixels.

返回

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

转为图片

函数

A texture as an ordinary 8-bit picture, for saving or for nodes that take pictures: colour encoded to sRGB, data written as it is.

签名
转为图片(纹理: Texture) -> Pixel Image
PixelImage ToPicture(Texture texture)

参数

名称类型默认值说明
纹理Texture—The texture.

返回

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

统一颜色

函数

A colour texture of one colour everywhere. The colour is given as it looks on screen (sRGB) and held in linear light.

签名
统一颜色(颜色: 颜色, 尺寸: 整数) -> Texture
Texture UniformColor(ColorElement color, int size = 1024)

参数

名称类型默认值说明
颜色颜色—The colour.
尺寸整数1024Width and height in pixels.

返回

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

统一值

函数

A greyscale texture of one value everywhere: a flat height, a constant roughness.

签名
统一值(值: 数字, 尺寸: 整数) -> Texture
Texture UniformValue(double value = 0.5, int size = 1024)

参数

名称类型默认值说明
值数字0.5The value, usually between 0 and 1.
尺寸整数1024Width and height in pixels.

返回

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