MaterialX 节点
MaterialX 是由工业光魔(ILM)开发的一种开源材质交换格式,虚幻引擎不仅支持它,还为 MaterialX 增加了一些额外的实用节点。不过,这些节点比较“隐蔽”,在材质编辑器中无法直接通过搜索找到。
为了方便大家使用这些节点,我整理了对应的代码。你只需复制代码并粘贴到材质编辑器中,即可轻松调用这些隐藏的功能节点。
Append3
功能简介
Append3
与虚幻引擎自带的 Append
节点类似,但它可以直接合并三个通道。而使用传统的方式合并多个通道时,节点连接会显得非常繁琐和凌乱。
效果图
传统方式的对比
使用代码
Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_0"
Begin Object Class=/Script/InterchangeImport.MaterialExpressionAppend3Vector Name="MaterialExpressionAppend3Vector_0"
End Object
MaterialExpression=/Script/InterchangeImport.MaterialExpressionAppend3Vector'"MaterialExpressionAppend3Vector_0"'
Append4
功能简介
Append4
是 Append3
的扩展版本,它可以一次性合并四个通道。
效果图
使用代码
Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_0"
Begin Object Class=/Script/InterchangeImport.MaterialExpressionAppend4Vector Name="MaterialExpressionAppend4Vector_0"
End Object
MaterialExpression=/Script/InterchangeImport.MaterialExpressionAppend4Vector'"MaterialExpressionAppend4Vector_0"'
Remap
功能简介
Remap
节点与虚幻引擎自带的 Remap
函数功能一致,但它的优点在于不限制输入的通道数量。
效果图
传统方式的对比
使用代码
Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_0"
Begin Object Class=/Script/InterchangeImport.MaterialExpressionRemap Name="MaterialExpressionRemap_0"
End Object
MaterialExpression=/Script/InterchangeImport.MaterialExpressionRemap'"MaterialExpressionRemap_0"'
Luminance
功能简介
Luminance
节点用于计算输入值的亮度,并支持多种亮度计算模式(例如 ACEScg)。当选择“自定义”模式时,会使用 亮度系数
的值(默认设置为绿色通道的亮度系数)。
效果图
使用代码
Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_0"
Begin Object Class=/Script/InterchangeImport.MaterialExpressionLuminance Name="MaterialExpressionLuminance_0"
End Object
MaterialExpression=/Script/InterchangeImport.MaterialExpressionLuminance'"MaterialExpressionLuminance_0"'