public override void CreateConnections(MaterialExpressionPower unrealNode, Material unrealMaterial, ShaderGraphBuilder builder) { builder.Connect(unrealNode.Value, unrealNode.Name, 0); if (unrealNode.Exponent != null) { builder.Connect(unrealNode.Exponent, unrealNode.Name, 1); } }
public override void CreateConnections(MaterialExpressionAdd unrealNode, Material unrealMaterial, ShaderGraphBuilder builder) { if (unrealNode.A != null) { builder.Connect(unrealNode.A, unrealNode.Name, 0); } if (unrealNode.B != null) { builder.Connect(unrealNode.B, unrealNode.Name, 1); } }
public override void CreateConnections(MaterialExpressionFresnel unrealNode, Material unrealMaterial, ShaderGraphBuilder builder) { if (unrealNode.Normal != null) { builder.Connect(unrealNode.Normal, unrealNode.Name, 0); } if (unrealNode.BaseReflectFractionIn != null) { Debug.Log("FIXME: unhandled fresnel baseReflectFractionIn/baseReflectFraction"); } if (unrealNode.ExponentIn != null) { Debug.Log("FIXME: unhandled fresnel exponentIn/exponent"); } if (unrealNode.Power != null) { builder.Connect(unrealNode.Power, unrealNode.Name, 2); } }
public override void CreateConnections(MaterialExpressionMaterialFunctionCall unrealNode, Material unrealMaterial, ShaderGraphBuilder builder) { foreach (var functionInput in unrealNode.FunctionInputs) { var inputPropertyBag = ValueUtil.ParseAttributeList(functionInput.FindPropertyValue("Input")); var expressionValue = ValueUtil.ParseExpressionReference(inputPropertyBag.FindPropertyValue("Expression")); var resolvedFunctionInput = unrealMaterial.ResolveExpressionReference(expressionValue); if (resolvedFunctionInput != null) { var slotId = GetConnectionIdSlotForFunctionInput(inputPropertyBag.FindPropertyValue("InputName"), resolvedFunctionInput); var inputSlot = builder.FindSlot <MaterialSlot>(resolvedFunctionInput?.Name, unrealNode.Name, slotId, inputPropertyBag); builder.Connect(resolvedFunctionInput?.Name, unrealNode.Name, slotId, inputPropertyBag); } } }