Artistic Nodes
Adjustment
Channel Mixer | Contrast |
---|---|
![]() | ![]() |
控制输入颜色的每个通道,相当于调节每个通道的值 | 调节对比度 |
Hue | Invert Colors |
![]() | ![]() |
调节色调偏移,根据range的不同模式 | 在每个通道的基础上反转输入的颜色。 |
Replace Color | Saturation |
![]() | ![]() |
把输入的颜色在form和to之间转换,具体转换成哪个颜色, 根据range来控制,就相当于渐变,fuzziness是羽化,就是边缘模糊 | 调节饱和度 |
White Balance | |
![]() | |
白平衡,调节色温色调 |
Blend
Blend |
---|
![]() |
把输入的blend和base混合起来 |
Filter
Dither |
---|
![]() |
产生随机噪点,也就i是随机的颜色 |
Mask
Channel Mask | Color Mask |
---|---|
![]() | ![]() |
选定通道的遮罩值 | 为输入值创建一个颜色遮罩 |
Normal
Normal Blend | Normal From Height |
---|---|
![]() | ![]() |
混合ab的法线 | 从输入贴图的高度映射纹理上创建一个法线贴图 |
Normal Strength | Normal Unpack |
![]() | ![]() |
调节法线的强度 | 解压输入的法线映射 |
Utility
Colorspace Conversion |
---|
![]() |
返回输入颜色从一个颜色空间转换到另一个颜色空间色结果 |
Channel Mixer Node
调节每一个通道的值. 滑块控制同导致在-2到2之间.RGB开关表示输出的控制的是哪个通道
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Vector 3 | None | Input value |
Out | Output | Vector 3 | None | Output value |
Controls
Name | Type | Options | Description |
---|---|---|---|
Toggle Button Array | R, G, B | Selects the output channel to edit. | |
R | Slider | Controls contribution of input red channel to selected output channel. | |
G | Slider | Controls contribution of input green channel to selected output channel. | |
B | Slider | Controls contribution of input blue channel to selected output channel. |
Shader Function
Generated Code Example
_ChannelMixer_Red = float3 (OutRedInRed, OutRedInGreen, OutRedInBlue);
_ChannelMixer_Green = float3 (OutGreenInRed, OutGreenInGreen, OutGreenInBlue);
_ChannelMixer_Blue = float3 (OutBlueInRed, OutBlueInGreen, OutBlueInBlue);
void Unity_ChannelMixer_float(float3 In, float3 _ChannelMixer_Red, float3 _ChannelMixer_Green, float3 _ChannelMixer_Blue, out float3 Out)
{
Out = float3(dot(In, _ChannelMixer_Red), dot(In, _ChannelMixer_Green), dot(In, _ChannelMixer_Blue));
}
Contrast Node
调节对比度,contrast为1时表示和原图一样,为0时表示是原来对比度的一半
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Vector 3 | None | Input value |
Contrast | Input | Vector 1 | None | Contrast value |
Out | Output | Vector 3 | None | Output value |
Generated Code Example
The following example code represents one possible outcome of this node.
void Unity_Contrast_float(float3 In, float Contrast, out float3 Out)
{
float midpoint = pow(0.5, 2.2);
Out = (In - midpoint) * Contrast + midpoint;
}
Hue Node
根据range的模式控制该模式下的色调偏移,就像加了一个颜色滤镜一样. Degrees 在-180 to 180. Radians it is -Pi to Pi.
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Vector 3 | None | Input value |
Offset | Input | Vector 1 | None | Amount to offset hue |
Out | Output | Vector 3 | None | Output value |
Controls
Name | Type | Options | Description |
---|---|---|---|
Range | Dropdown | Degrees, Radians | The unit used for the input Offset |
Generated Code Example
The following example code represents one possible outcome of this node per Base mode.
Degrees
void Unity_Hue_Degrees_float(float3 In, float Offset, out float3 Out)
{
float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
float4 P = lerp(float4(In.bg, K.wz), float4(In.gb, K.xy), step(In.b, In.g));
float4 Q = lerp(float4(P.xyw, In.r), float4(In.r, P.yzx), step(P.x, In.r));
float D = Q.x - min(Q.w, Q.y);
float E = 1e-10;
float3 hsv = float3(abs(Q.z + (Q.w - Q.y)/(6.0 * D + E)), D / (Q.x + E), Q.x);
float hue = hsv.x + Offset / 360;
hsv.x = (hue < 0)
? hue + 1
: (hue > 1)
? hue - 1
: hue;
float4 K2 = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
float3 P2 = abs(frac(hsv.xxx + K2.xyz) * 6.0 - K2.www);
Out = hsv.z * lerp(K2.xxx, saturate(P2 - K2.xxx), hsv.y);
}
Radians
void Unity_Hue_Radians_float(float3 In, float Offset, out float3 Out)
{
float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
float4 P = lerp(float4(In.bg, K.wz), float4(In.gb, K.xy), step(In.b, In.g));
float4 Q = lerp(float4(P.xyw, In.r), float4(In.r, P.yzx), step(P.x, In.r));
float D = Q.x - min(Q.w, Q.y);
float E = 1e-10;
float3 hsv = float3(abs(Q.z + (Q.w - Q.y)/(6.0 * D + E)), D / (Q.x + E), Q.x);
float hue = hsv.x + Offset;
hsv.x = (hue < 0)
? hue + 1
: (hue > 1)
? hue - 1
: hue;
// HSV to RGB
float4 K2 = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
float3 P2 = abs(frac(hsv.xxx + K2.xyz) * 6.0 - K2.www);
Out = hsv.z * lerp(K2.xxx, saturate(P2 - K2.xxx), hsv.y);
}
Invert Colors Node
基于各个通道的反转颜色. 此节点假设所有输入值都在0 - 1范围内。相当于ps里面的只使用单通道
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Dynamic Vector:vector可以是1.2.3.4维的 | None | Input value |
Out | Output | Dynamic Vector | None | Output value |
Controls
Name | Type | Options | Description |
---|---|---|---|
Red | Toggle | True, False | If true red channel is inverted |
Green | Toggle | True, False | If true green channel is inverted. Disabled if input vector dimension is less than 2 |
Blue | Toggle | True, False | If true blue channel is inverted. Disabled if input vector dimension is less than 3 |
Alpha | Toggle | True, False | If true alpha channel is inverted. Disabled if input vector dimension is less than 4 |
Generated Code Example
The following example code represents one possible outcome of this node.
float2 _InvertColors_InvertColors = float4(Red, Green, Blue, Alpha);
void Unity_InvertColors_float4(float4 In, float4 InvertColors, out float4 Out)
{
Out = abs(InvertColors - In);
}
Replace Color Node
把输入的值中含有的from替换为to. Range 是替换的范围. Fuzziness边缘羽化
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Vector 3 | None | Input value |
From | Input | Vector 3 | Color | Color to replace |
To | Input | Vector 3 | Color | Color to replace with |
Range | Input | Vector 1 | None | Replace colors within this range from input From |
Fuzziness | Input | Vector 1 | None | Soften edges around selection |
Out | Output | Vector 3 | None | Output value |
Generated Code Example
The following example code represents one possible outcome of this node.
void Unity_ReplaceColor_float(float3 In, float3 From, float3 To, float Range, float Fuzziness, out float3 Out)
{
float Distance = distance(From, In);
Out = lerp(To, In, saturate((Distance - Range) / max(Fuzziness, e-f)));
}
Saturation Node
调节饱和度,1代表和原图一样,0代表没有饱和度,可以乘以一个数,增加饱和度
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Vector 3 | None | Input value |
Saturation | Input | Vector 1 | None | Saturation value |
Out | Output | Vector 3 | None | Output value |
Generated Code Example
The following example code represents one possible outcome of this node.
void Unity_Saturation_float(float3 In, float Saturation, out float3 Out)
{
float luma = dot(In, float3(0.2126729, 0.7151522, 0.0721750));
Out = luma.xxx + Saturation.xxx * (In - luma.xxx);
}
White Balance Node
调节色温和色调. Temperature 影响的是黄色和蓝色yellow or blue. Tint 影响的是粉红色和绿色 pink or green.
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Vector 3 | None | Input value |
Temperature | Input | Vector 1 | None | Temperature offset value |
Tint | Input | Vector 1 | None | Tint offset value |
Out | Output | Vector 3 | None | Output value |
Generated Code Example
The following example code represents one possible outcome of this node.
void Unity_WhiteBalance_float(float3 In, float Temperature, float Tint, out float3 Out)
{
// Range ~[-1.67;1.67] works best
float t1 = Temperature * 10 / 6;
float t2 = Tint * 10 / 6;
// Get the CIE xy chromaticity of the reference white point.
// Note: 0.31271 = x value on the D65 white point
float x = 0.31271 - t1 * (t1 < 0 ? 0.1 : 0.05);
float standardIlluminantY = 2.87 * x - 3 * x * x - 0.27509507;
float y = standardIlluminantY + t2 * 0.05;
// Calculate the coefficients in the LMS space.
float3 w1 = float3(0.949237, 1.03542, 1.08728); // D65 white point
// CIExyToLMS
float Y = 1;
float X = Y * x / y;
float Z = Y * (1 - x - y) / y;
float L = 0.7328 * X + 0.4296 * Y - 0.1624 * Z;
float M = -0.7036 * X + 1.6975 * Y + 0.0061 * Z;
float S = 0.0030 * X + 0.0136 * Y + 0.9834 * Z;
float3 w2 = float3(L, M, S);
float3 balance = float3(w1.x / w2.x, w1.y / w2.y, w1.z / w2.z);
float3x3 LIN_2_LMS_MAT = {
3.90405e-1, 5.49941e-1, 8.92632e-3,
7.08416e-2, 9.63172e-1, 1.35775e-3,
2.31082e-2, 1.28021e-1, 9.36245e-1
};
float3x3 LMS_2_LIN_MAT = {
2.85847e+0, -1.62879e+0, -2.48910e-2,
-2.10182e-1, 1.15820e+0, 3.24281e-4,
-4.18120e-2, -1.18169e-1, 1.06867e+0
};
float3 lms = mul(LIN_2_LMS_MAT, In);
lms *= balance;
Out = mul(LMS_2_LIN_MAT, lms);
}
Blend Node
Description
把Blend 根据不同的混合模式混合进Base . Opacity控制混合的强度,为0时,表示没有混合,显示的是base的颜色
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
Base | Input | Dynamic Vector | None | Base layer value |
Blend | Input | Dynamic Vector | None | Blend layer value |
Opacity | Input | Vector 1 | None | Strength of blend |
Out | Output | Dynamic Vector | None | Output value |
Controls
Name | Type | Options | Description |
---|---|---|---|
Mode | Dropdown | Burn, Darken, Difference, Dodge, Divide, Exclusion, HardLight, HardMix, Lighten, LinearBurn, LinearDodge, LinearLight, LinearLightAddSub, Multiply, Negation, Overlay, PinLight, Screen, SoftLight, Subtract, VividLight, Overwrite | Blend mode to apply |
Dither Node
Dither 是一种用于随机量化误差的噪声. Dither 使用 screen-space 确保均衡分配噪点. 可以通过 Screen Position调节,通常作为 Alpha Clip Threshold 输入节点,给物体一个随机的透明度显示. 它对于创建看起来透明但具有呈现为不透明的优势的对象很有用,比如写入深度和/或延迟呈现。
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Dynamic Vector | None | Input value |
Screen Position | Input | Vector 4 | Screen Position | Coordinates used to apply dither pattern |
Out | Output | Dynamic Vector | None | Output value |
Generated Code Example
The following example code represents one possible outcome of this node.
void Unity_Dither_float4(float4 In, float4 ScreenPosition, out float4 Out)
{
float2 uv = ScreenPosition.xy * _ScreenParams.xy;
float DITHER_THRESHOLDS[16] =
{
1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
};
uint index = (uint(uv.x) % 4) * 4 + uint(uv.y) % 4;
Out = In - DITHER_THRESHOLDS[index];
}
Channel Mask Node
选定通道的遮罩值.如果遮罩值为everything的话,就相当于没有遮罩
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Dynamic Vector | None | Input value |
Out | Output | Dynamic Vector | None | Output value |
Controls
Name | Type | Options | Description |
---|---|---|---|
Channels | Mask Dropdown | Dynamic | 选择要屏蔽的任何数量的通道 |
Generated Code Example
The following example code represents one possible outcome of this node.
void Unity_ChannelMask_RedGreen_float4(float4 In, out float4 Out)
{
Out = float4(0, 0, In.b, In.a);
}
Color Mask Node
没那么简单,看效果就好像是变成黑白通道了,不过可以做消隐效果,range是滤镜的范围或者强度.Fuzziness 羽化边缘
Ports
Name | Direction | Type | Binding | Description |
---|---|---|---|---|
In | Input | Vector 3 | None | Input value. |
Mask Color | Input | Vector 3 | Color | Color to use for mask. |
Range | Input | Vector 1 | None | Select colors within this range from input Mask Color. |
Fuzziness | Input | Vector 1 | None | Feather edges around selection. Higher values result in a softer selection mask. |
Out | Output | Vector 1 | None | Output mask value. |
Generated Code Example
The following example code represents one possible outcome of this node.
void Unity_ColorMask_float(float3 In, float3 MaskColor, float Range, float Fuzziness, out float4 Out)
{
float Distance = distance(MaskColor, In);
Out = saturate(1 - (Distance - Range) / max(Fuzziness, 1e-5));
}
Colorspace Conversion Node
把一个颜色从一个颜色空间转换到另一个颜色空间
Ports
Name | Direction | Type | Description |
---|---|---|---|
In | Input | Vector 3 | Input value |
Out | Output | Vector 3 | Output value |
Controls
Name | Type | Options | Description |
---|---|---|---|
From | Dropdown | RGB, Linear, HSV | Selects the colorspace to convert from |
To | Dropdown | RGB, Linear, HSV | Selects the colorspace to convert to |