《Unity着色器圣经》9.0.5 | Graph检查器

目录索引

译文

Graph 检查器(Graph Inspector)可能根据 Shader Graph 的版本而有所不同,其 10.6.0 版本的外观如图 9.0.5a 所示。

根据 Unity 官方文档:

Graph Inspector用于与Shader Graph Asset的任何可选图形元素和图形范围的设置进行交互。您可以使用Graph Inspector编辑属性和默认值

总的来说,面板分为节点(Node)图形(Graph)两个选项卡,允许我们配置颜色输出的属性。我们可以从中找到混合、剔除、透明度测试等等选项。同时,我们还可以调整节点的配置。

图片[1]-《Unity着色器圣经》9.0.5 | Graph检查器-软件开发学习笔记
Fig. 9.0.5a

图形设置中包含了所有节点的一般属性,换句话说,就是我们之前用来定义屏幕像素行为的那些命令,例如,一旦我们确定了着色器中的表面(Surface)类型,就会启用混合(Blend)命令 [SourceFactor] [DestinationFactor] 。同样,我们也可以通过 Two Sides 复选框启用或禁用剔除(Cull)命令。

节点设置包含了被选中元素的属性,例如自定义函数节点的精度(precision)、预览选项(preview options)、输入输出等等。对于其他节点,只显示精度和预览选项。

我们在 Blackboard 中添加的属性也反映了同样的行为。如图 9.0.5b 所示,节点设置选项卡中出现了我们在编写着色器时手动添加的属性。

图片[2]-《Unity着色器圣经》9.0.5 | Graph检查器-软件开发学习笔记
Fig. 9.0.5b

精度(precision)属性指的是节点在 GPU 上计算时的小数位数。默认情况下,它被设置为“inherit”(继承 Graph设置中的精度)。我们可以将其更改为“single”,计算结果包含了小数点后六位的精度,也可以更改为“half”,即只有小数点后三位的精度。


原文对照

This panel may have some aesthetic variations depending on the Shader Graph version. Its version 10.6.0 looks like in figure 9.0.5a.

According to the official documentation in Unity;

The Graph Inspector allows us to interact with any selectable element and settings in Shader Graph. We can use the Graph Inspector to edit attributes and values.

To summarize, this panel, divided into two sections called Node and Graph, has those configurable properties that allow modifying the color output. We can find blending, cull, and alpha clip options among them. Also, we can adjust the properties of the nodes in our configuration.

图片[1]-《Unity着色器圣经》9.0.5 | Graph检查器-软件开发学习笔记
Fig. 9.0.5a

On the one hand, Graph Settings has the general properties of the node, in other words, those commands that we use previously to define the behavior of the screen pixels, e.g., the Blend [SourceFactor] [DestinationFactor] command is enabled once we determine the type of “surface” in the shader. Likewise, we can enable or disable the Cull command through the “Two Sides” checkbox.

On the other hand, Node Settings contains the attributes of those selected elements, e.g., in the Custom Function node, the precision, and preview options appear in it, as well as those inputs and outputs that can be configured according to the operation being carried out. For the remaining ones, only the precision and preview options appear.

This same behavior is reflected in the properties we have added to the Blackboard. As we can see in Figure 9.0.5b, in the tab appear those attributes that we added manually in the writing of a shader.

图片[2]-《Unity着色器圣经》9.0.5 | Graph检查器-软件开发学习笔记
Fig. 9.0.5b

The “precision” attribute refers to the calculation in decimal places of a node on the GPU. By default, it is set to “inherit.” However, we can change it to “single” (float), which contains six decimal places of precision, or to “half,” which has only three decimal places.

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容