元編程參考文件

紋理來源

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
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
紋理來源
所屬包
影像處理