Merge branch 'Evildea-master'
This commit is contained in:
@@ -642,6 +642,22 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
NodeElementArchetype.Factory.Output(0, "XYZ", typeof(Vector3), 0),
|
||||
}
|
||||
},
|
||||
new NodeArchetype
|
||||
{
|
||||
TypeID = 26,
|
||||
Title = "Blend Normals",
|
||||
Description = "Blend two normal maps to create a single normal map",
|
||||
Flags = NodeFlags.MaterialGraph,
|
||||
Size = new Vector2(170, 40),
|
||||
ConnectionsHints = ConnectionsHint.Vector,
|
||||
Elements = new[]
|
||||
{
|
||||
NodeElementArchetype.Factory.Input(0, "Base Normal", true, typeof(Vector3), 0),
|
||||
NodeElementArchetype.Factory.Input(1, "Additional Normal", true, typeof(Vector3), 1),
|
||||
NodeElementArchetype.Factory.Output(0, "Result", typeof(Vector3), 2)
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,6 +339,14 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
case 25:
|
||||
value = Value(VariantType::Vector3, TEXT("GetObjectSize(input)"));
|
||||
break;
|
||||
case 26:
|
||||
{
|
||||
const auto BaseNormal = tryGetValue(node->GetBox(0), Value::Zero).AsVector3();
|
||||
const auto AdditionalNormal = tryGetValue(node->GetBox(1), Value::Zero).AsVector3();
|
||||
const String text = String::Format(TEXT("float3((float2({0}.xy) + float2({1}.xy) * 2.0), sqrt(saturate(1.0 - dot((float2({0}.xy) + float2({1}.xy) * 2.0).xy, (float2({0}.xy) + float2({1}.xy) * 2.0).xy))))"), BaseNormal.Value, AdditionalNormal.Value);
|
||||
value = writeLocal(ValueType::Vector3, text, node);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user