Blend By Height 示例
This material graph sample demonstrates how to perform blending based on heightmaps when creating materials.此材质图表示例演示了如何在创建材质时基于高度图执行混合。
Texture coordinates taken via the Vertex UV 0 node are multiplied by the first two components of the UV Transform float4 parameter, representing UV tiling adjustment, and increased by its last two components that represent a UV offset. The modified UV coordinates are connected to all Sample Texture nodes via portals for ease of access.通过 Vertex UV 0 节点获取的纹理坐标是倍增由 UV Transform float4 参数的前两个分量组成,表示 UV 平铺调整,并增加了表示 UV 偏移的最后两个分量。修改后的 UV 坐标通过以下方式连接到所有 Sample Texture 节点门户为了方便访问。
Two height values sampled from the corresponding textures in accordance with the modified UVs are passed to the Blend By Height node. Height 0 Scale, Height 1 Scale, and Contrast values are taken from parameter Sliders enabling you to adjust these values via the Parameters panel.根据修改后的 UV 从相应纹理中采样的两个高度值被传递到 Blend By Height 节点。 Height 0 Scale、Height 1 Scale 和 Contrast 值取自参数滑块,使您可以通过 Parameters 面板调整这些值。
The Result Height is connected to the Tessellation Vertex Offset Tangent Space port of the material via the 0,0,x port adapter (meaning that the value shall control displacement along the Z-axis only, keeping X and Y as they are). The Result Blend Mask is used as a blending coefficient for the Lerp nodes performing linear interpolation between two sets of Albedo and tangent-space Normal textures.Result Height 通过 0,0,x 连接到材质的 Tessellation Vertex Offset Tangent Space 端口端口适配器(意味着该值应仅控制沿 Z 轴的位移,保持 X 和 Y 不变)。 Result Blend Mask 用作在两组 Albedo 和切线空间 Normal 纹理之间执行线性插值的 Lerp 节点的混合系数。