Vertex Color 示例
This material graph sample demonstrates how to use vertex color for texture blending when creating materials.此材质图表示例演示了在创建材质时如何使用顶点颜色进行纹理混合。
Vertex color data retrieved via the Vertex Color node is passed to a portal for the ease of access. 4 sets of Albedo and tangent-space Normal textures are blended with accordance to the channels of the vertex color data:通过 Vertex Color 节点检索到的顶点颜色数据被传递到门户网站为了方便访问。 4组Albedo和切线空间法线纹理按照顶点颜色数据的通道进行混合:
- Each of the color channels (RGB) gets its own Linear Interpolation expression.每个颜色通道 (RGB) 都有自己的线性插值表达式。
- The data from the first Albedo A texture sampled by the Sample Texture node is plugged to the A port of the first Lerp node.Sample Texture 节点采样的第一个Albedo A纹理的数据被插入到第一个 Lerp 节点的A端口。
- The data from each of the other three albedo Textures (B-D) sampled by the corresponding Sample Texture node is plugged to the B port of its corresponding Lerp node.由对应的 Sample Texture 节点采样的其他三个反照率纹理 (BD) 中的每一个的数据被插入到其对应的 Lerp 节点的 B 端口。
- The first Lerp node corresponding to the Texture A plugs into the A port of the Lerp node corresponding to Texture B, with Coefficient driven by the Red channel from the vertex color (connected via the x port adapter).纹理 A 对应的第一个 Lerp 节点插入到纹理 B 对应的 Lerp 节点的 A 端口,系数由顶点颜色的红色通道驱动(通过 x 连接端口适配器)。
- The second Lerp node corresponding to Texture B plugs into the A port of the Lerp node corresponding to Texture C, with Coefficient driven by the Green channel from the vertex color (connected via the y port adapter).对应于纹理 B 的第二个 Lerp 节点插入对应于纹理 C 的 Lerp 节点的 A 端口,系数由顶点颜色的绿色通道驱动(通过 y 端口适配器连接)。
- The third Lerp node corresponding to Texture C plugs into the Albedo port of the master material node, with Coefficient driven by the Blue channel from the vertex color (connected via the z port adapter).对应于纹理 C 的第三个 Lerp 节点插入主材质节点的 Albedo 端口,系数由顶点颜色的蓝色通道驱动(通过 z 端口适配器连接)。
- Four Normal maps sampled by the corresponding Sample Texture nodes have the same kind of setup of Linear Interpolation expressions.由相应的 Sample Texture 节点采样的四个法线贴图具有相同的线性插值表达式设置。
Finally, the data output is passed to the Final node.最后,将数据输出传递给 Final 节点。
The result结果
最新更新:
2024-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)