Sub Graph Asset
Node
一个节点包含一个或多个 input, output 和操作 operation ,一个节点也可能有任意数量的控件,这些是节点上没有端口的控件。
你可以折叠没有连接得节点,通过点击右上角的折叠按钮
For components of a Node see:
Preview
有些节点在节点上有预览.此预览将在图中显示该阶段的主要输出值. 当鼠标光标悬停在节点上时,将显示此输出信息.
Context Menu
在节点上右键
Item | Description |
---|---|
Copy Shader | Copies the generated HLSL code at this stage in the graph to the clipboard |
Disconnect All | Removes all Edges from all Ports on the Node(s) |
Cut | Cuts selected Node(s) to the clipboard |
Copy | Copies selected Nodes(s) to the clipboard |
Paste | Pastes Node(s) in the clipboard |
Delete | Deletes selected Node(s) |
Duplicate | Duplicates selected Node(s) |
Convert To Sub-graph | 创建一个 Sub-graph Asset with the selected Node(s) included |
Convert To Inline Node | 把属性节点转换成一个常规节点,数据类型保持一致 Property Node into a regular node of the appropriate Data Type |
Convert To Property | 把常规节点转换成属性节点,并显示在blackboard上 Converts a Node into a new Property on the Blackboard of the appropriate Property Type |
Open Documentation | Opens a new web browser to the selected Nodes documentation page in the Node Library |
blackboard中的属性节点和工作区的属性节点二者是关联的,当blackboard中的源节点删除后,工作区的原属性节点就会变成常规节点,inline就是不关联的意思
Port
端口通过连线来传递数据.
每一个端口都定义了需要传入的数据的类型. 每一个数据类型都有它自己的一个颜色.
输入端口只能连接一条线,输出端口可以连接多条线
你也可以通过拖动鼠标拖动端口到工作区域来创建节点,这个节点的类型是这个输出端口数据类型能传入的类型
Default Inputs
节点左边的是输入端口, :当没有连接边缘时,这将作为一个小字段连接到端口. 除非端口具有端口绑定,否则此字段将显示端口数据类型的输入.如果一个有端口绑定的默认输入端口将显示一个特殊的框,比如选择uv通道的下拉框 ,或者是一个标签帮助你理解输入类型
Custom Port Menu
在 Custom Function Node 和 Sub Graph 输出端口可以使用自定义端口. 你能够添加,删除,重命名,排序,定义端口的类型
How to Use
点击自定义节点的齿轮按钮,可以打开输入节点编辑器
Adding and Removing Ports
To remove ports, select a port using the hamburger icon on the left, and click the -
icon at the bottom right corner of the port list.
Renaming Ports
双击重命名: A-Z, a-z, 0-9, _, ( ), and 空格键. .
Reordering Ports
拖拽左边的按钮编排顺序
Changing Port Types
右边编辑框改变数据类型
Property Types
在blackboard上的属性类型
Common Parameters
每一个属性都有以下三种参数
Name | Type | Description |
---|---|---|
Display Name | String | 属性名 |
Exposed | Boolean | 是否在material面板上显示 |
Reference Name | String | c#引用名 |
NOTE: 引用名遵循以下规则
- If your Reference Name 以下划线头,如果不是,会自动添加上
- If your Reference Name 里面的字符必须是HLSL支持的,如果不支持,会自动去掉
- 点击revert会复原原来的名字
Vector 1
Vector 1值,含有三种Mode
Data Type | Modes |
---|---|
Vector 1 | Default, Slider, Integer |
Default
默认值,显示一个参数输入区
Field | Type | Description |
---|---|---|
Default | Vector 1 | The default value of the Property. |
Slider
一个滑动条
Field | Type | Description |
---|---|---|
Default | Vector 1 | The default value of the Property. |
Min | Vector 1 | The minimum value of the slider. |
Max | Vector 1 | The maximum value of the slider. |
Integer
整数区域
Field | Type | Description |
---|---|---|
Default | Integer | The default value of the Property. |
Vector 2
显示一个四维输入框,只不过z w 不使用 Vector 4 input field in the material inspector, where the z and w components are not used.
Data Type | Modes |
---|---|
Vector 2 |
Field | Type | Description |
---|---|---|
Default | Vector 2 | The default value of the Property. |
Vector 3
显示一个四维输入框,只不过 w 不使用. Displays a Vector 4 input field in the material inspector, where the w component is not used.
Data Type | Modes |
---|---|
Vector 3 |
Field | Type | Description |
---|---|---|
Default | Vector 3 | The default value of the Property. |
Vector 4
显示一个四维输入框 Displays a Vector 4 input field in the material inspector.
Data Type | Modes |
---|---|
Vector 4 |
Field | Type | Description |
---|---|---|
Default | Vector 4 | The default value of the Property. |
Color
Defines a Color value.
Data Type | Modes |
---|---|
Color | Default, HDR |
Default
Displays an sRGB color field in the material inspector.
Field | Type | Description |
---|---|---|
Default | Vector 4 | The default value of the Property. |
HDR
Displays an HDR color field in the material inspector.
Field | Type | Description |
---|---|---|
Default | Vector 4 | The default value of the Property. |
Texture 2D
Defines a Texture 2D value. Displays an object field of type Texture in the material inspector.
Data Type | Modes |
---|---|
Texture | White, Black, Grey, Bump |
Field | Type | Description |
---|---|---|
Default | Texture | The default value of the Property. |
Texture 3D
Defines a Texture 3D value. Displays an object field of type Texture 3D in the material inspector.
Data Type | Modes |
---|---|
Texture |
Field | Type | Description |
---|---|---|
Default | Texture | The default value of the Property. |
Texture 2D Array
Defines a Texture 2D Array value. Displays an object field of type Texture 2D Array in the material inspector.
Data Type | Modes |
---|---|
Texture |
Field | Type | Description |
---|---|---|
Default | Texture | The default value of the Property. |
Cubemap
Defines a Cubemap value. Displays an object field of type Texture in the material inspector.
Data Type | Modes |
---|---|
Cubemap |
Field | Type | Description |
---|---|---|
Default | Cubemap | The default value of the Property. |
Boolean
Defines a Boolean value. Displays a ToggleUI field in the material inspector. Note that internally to the shader this value is a Vector 1. The Boolean type in Shader Graph is merely for usability.
Data Type | Modes |
---|---|
Boolean |
Field | Type | Description |
---|---|---|
Default | Boolean | The default value of the Property. |
Precision Types
精度类型
Precision Types
Name | Description |
---|---|
Half | 16位中精度浮点类型; (range of –60000 to +60000,保留三位小数).Half 对 short vectors, directions, object space positions, and high dynamic range colors.很有用 |
Float | 高精度浮点类型; generally 32 bits (identical to float in regular programming languages).Full float precision 对 world space positions, texture coordinates, and scalar computations that involve complex functions such as trigonometry(三角), power, and exponentiation(幂). |
Port Bindings
一些输入端口可能有端口绑定. 这表示这个端口需要一个输入连接,比如一个 Normal Vector or UV.但是, a Port Binding仅影响没有端口连接得端口. 这些端口仍然定义了需要介入的数据类型
实际上,这意味着如果没有边缘连接到端口,则该端口中使用的默认数据将从其端口绑定中获取.下面是端口绑定及其相关默认选项的完整列表。
Port Bindings List
Name | Data Type | Options | Description |
---|---|---|---|
Bitangent | Vector 3 | 顶点或片段双重切线,能接入的数据类型是transform space | |
Color | Vector 4 | RGBA Color picker | |
ColorRGB | Vector 3 | RGB Color picker | |
Normal | Vector 3 | Vertex or fragment 法线向量 vector, label describes expected transform space | |
Position | Vector 3 | Vertex or fragment position, label describes expected transform space | |
Screen Position | Vector 4 | Default, Raw, Center, Tiled | |
Tangent | Vector 3 | Vertex or fragment tangent vector, label describes expected transform space | |
UV | Vector 2 | UV0, UV1, UV2, UV3 | |
Vertex Color | Vector 4 | RGBA vertex color value. | |
View Direction | Vector 3 | Vertex or fragment view direction vector, label describes expected transform space |
Shader Stage
Shader Stage 指的是一个节点或端口所在的着色器管道的一部分. 比如:Vertex or Fragment. 在Shader Graph 中, Shader Stage 指每个端口,但通常一个节点上的所有端口都被锁定到相同的着色器阶段。由于底层着色器语言的限制,某些节点上的端口在某些着色器阶段不可用. See the Node Library documentation for Nodes that have Shader Stage restrictions.
Shader Stage List
Name | Description |
---|---|
Vertex | 每个顶点的运算 |
Fragment | 每个片段计算的操作 |