logo资料库

Unity ShaderGraph节点详解.pdf

第1页 / 共84页
第2页 / 共84页
第3页 / 共84页
第4页 / 共84页
第5页 / 共84页
第6页 / 共84页
第7页 / 共84页
第8页 / 共84页
资料共84页,剩余部分请下载后查看
Artistic Nodes
Adjustment 调整
Channel Mixer
Contrast
Hue
Invert Colors
Replace Color
Saturation
White Balance
Blend 混合
Filter 滤镜
Dither
Mask 遮罩
Channel Mask
Color Mask
Normal 法线
Normal Blend 法线混合
Normal Create 创建法线
Normal Strength
Normal Unpack
Utility 工具
Colorspace Conversion
Channel Nodes
Combine 组合
Flip 翻转
Split 分割
Swizzle (打乱)
Input Nodes 输入节点
Basic 基础
Boolean
Color
Constant
Integer
Slider
Time
Vector1/2/3/4
Geometry 几何
Bitangent Vector
Normal Vector
Position
Screen Position
Tangent Vector
UV
Vertex Color
View Direction
Matrix 矩阵
Matrix 2x2/3x3/4x4
Transformation Matrix
PBR
Dielectric Specular
Metal Reflectance
Scene 场景
Ambient 环境
Camera 相机
Fog 雾
Light Probe 光照探头
Object
Reflection Probe 反射探头
Screen 屏幕
Texture
Cubemap Asset
Sample Cubemap
Sample Texture 2D
Sampler State
Texture 2D Asset
Master Nodes 主节点
PBR Master
Unlit Master
Math Nodes 数学节点
Advanced
Absolute 绝对值
Exponential 指数
Length 模长
Log 对数
Modulo 模数
Negate 相反数
Normalize 单位化
Posterize 色调分离
Reciprocal 倒数
Reciprocal Square Root 平方根倒数
Basic 基本运算符
Add 加法
Divide 除法
Multiply 乘法
Power 幂
Square Root 平方根
Subtract 减法
Derivative 导数
DDX
DDXY
DDY
Interpolation 插值
Lerp 线性插值
Inverse Lerp 反向线性插值
Smoothstep 平滑阶梯
Matrix 矩阵
Matrix Construct 构造矩阵
Matrix Determinant 矩阵行列式
Matrix Split 分割矩阵
Matrix Transpose 矩阵转置
Range 范围
Clamp
Fraction 取小数部分
Maximum 最大值
Minimum 最小值
One Minus 1减去
Random Range 范围随机
Remap 重映射
Saturate
Round 四舍五入
Ceiling 向上取整
Floor 向下取整
Round 四舍五入
Sign 正负符号
Step 阶梯
Truncate 截取(舍弃小数)
Trigonometry 三角函数
Arccosine 反余弦arccos
Arcsine 反正弦arcsin
Arctangent 反正切arctan
Arctangent2 即Atan2
Cosine 余弦cos
Degrees To Radians 角度转弧度
Hyperbolic Cosine 双曲余弦cosh
Hyperbolic Sine 双曲正弦sinh
Hyperbolic Tangent 双曲正切tanh
Radians To Degrees 弧度转角度
Sine 正弦sin
Tangent 正切tan
Vector 向量
Cross Product 叉乘
Distance 距离
Dot Product 点乘
Fresnel Effect 菲涅尔效应
Projection 投影
Rejection
Procedural Nodes 程序化节点
Checkerboard 检查板
Noise 噪点
Gradient Noise 渐变噪点
Simple Noise
Voronoi 泰森多边形
Shape 形状
Ellipse 椭圆
Polygon 多边形
Rectangle 矩形
Rounded Rectangle 圆角矩形
Utility Nodes 工具节点
Preview 预览
Logic 逻辑操作
All
And
Any
Branch 分支
Comparison 比较
Is Infinite 是否无穷大
Is NaN 是否非数值
Nand 与非
UV Nodes UV节点
Flipbook 图象序列
Polar Coordinates 极坐标
Radial Shear 径向剪切
Rotate 旋转
Spherize 球面化
Tiling And Offset 平铺和偏移
Triplanar
Twirl 扭曲
小结
本文首发于洪流学堂微信公众号。 洪流学堂,学Unity快人几步     本系列已经完结,但后续可能有更新。洪流学堂公众号回复 节点 ,获取ShaderGraph节点详解PDF文件(带目 录)。 注意 节点中很多输入为In(1)的其实是动态长度的Vector,可以接收Vector1~Vector4的值哦 Artistic Nodes Adjustment 调整
Channel Mixer 根据输入的RGB值及各个通道的权重,输出权重加成后的RGB值。 举例:输入RGB为(0.8,0.6,0.4),假设输出R通道的比重设置为(0.1, 0.2, 0.3),则输出R的值为 0.8x0.1+0.6x0.2+0.4x0.3 = 0.32
_Node_OutRed = float3 (OutRedInRed, OutRedInGreen, OutRedInBlue); _Node_OutGreen = float3 (OutGreenInRed, OutGreenInGreen, OutGreenInBlue); _Node_OutBlue = float3 (OutBlueInRed, OutBlueInGreen, OutBlueInBlue); Out = float3(dot(In, _Node_OutRed), dot(In, _Node_OutGreen), dot(In, _Node_OutBlue)); Contrast 根据输入In及Contrast调节对比度。Contrast为1时输出In,Contrast为0时输出In的中值。
float midpoint = pow(0.5, 2.2); Out = (In - midpoint) * Contrast + midpoint; Hue 根据Offset调节色相。 可以根据Degrees调节即(-180,180) 或者根据Normalized调节即(-1,1) Degree代码(Normalized类似): 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);
Invert Colors 反转颜色,可以选择单个或多个反转的通道 Replace Color 替换颜色 In:输入的颜色 From:要替换的颜色 To:替换成的颜色 Range:类似PS里的容差值 Fuzziness:软化选区的边缘
float Distance = distance(From, In); Out = lerp(To, In, saturate((Distance - Range) / max(Fuzziness, 1e-5f))); Saturation 饱和度。Saturation为1时输出原颜色,Saturation为0时为完全不饱和色。
float luma = dot(In, float3(0.2126729, 0.7151522, 0.0721750)); Out = luma.xxx + Saturation.xxx * (In - luma.xxx); White Balance 白平衡 Temperature 让颜色变黄或者变蓝 Tint 让颜色变粉或者变绿
// 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 };
分享到:
收藏